Workflows: fix and cleanup

This commit is contained in:
XargonWan 2024-09-19 13:41:26 +09:00
parent 1e3efd1b77
commit 1f6de046b1
2 changed files with 72 additions and 108 deletions

View file

@ -194,7 +194,7 @@ jobs:
# path: "duckstation-windows-arm64-release*.zip" # path: "duckstation-windows-arm64-release*.zip"
linux-build: linux-appimage:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
timeout-minutes: 120 timeout-minutes: 120
steps: steps:
@ -269,71 +269,71 @@ jobs:
path: "DuckStation-x64.AppImage" path: "DuckStation-x64.AppImage"
linux-flatpak-build: # linux-flatpak-build:
runs-on: ubuntu-22.04 # runs-on: ubuntu-22.04
container: # container:
image: ghcr.io/flathub-infra/flatpak-github-actions:kde-6.7 # image: ghcr.io/flathub-infra/flatpak-github-actions:kde-6.7
options: --privileged # options: --privileged
timeout-minutes: 120 # timeout-minutes: 120
steps: # steps:
- uses: actions/checkout@v4.1.6 # - uses: actions/checkout@v4.1.6
with: # with:
fetch-depth: 0 # fetch-depth: 0
set-safe-directory: ${{ env.GITHUB_WORKSPACE }} # set-safe-directory: ${{ env.GITHUB_WORKSPACE }}
# Work around container ownership issue # # Work around container ownership issue
- name: Set Safe Directory # - name: Set Safe Directory
shell: bash # shell: bash
run: git config --global --add safe.directory "*" # run: git config --global --add safe.directory "*"
- name: Initialize build tag # - name: Initialize build tag
run: | # run: |
echo '#pragma once' > src/scmversion/tag.h # echo '#pragma once' > src/scmversion/tag.h
- name: Generate AppStream XML # - name: Generate AppStream XML
run: | # run: |
scripts/generate-metainfo.sh scripts/flatpak # scripts/generate-metainfo.sh scripts/flatpak
cat scripts/flatpak/org.duckstation.DuckStation.metainfo.xml # cat scripts/flatpak/org.duckstation.DuckStation.metainfo.xml
- name: Validate AppStream XML # - name: Validate AppStream XML
run: flatpak-builder-lint appstream scripts/flatpak/org.duckstation.DuckStation.metainfo.xml # run: flatpak-builder-lint appstream scripts/flatpak/org.duckstation.DuckStation.metainfo.xml
- name: Validate manifest # - name: Validate manifest
run: flatpak-builder-lint manifest scripts/flatpak/org.duckstation.DuckStation.yaml # run: flatpak-builder-lint manifest scripts/flatpak/org.duckstation.DuckStation.yaml
- name: Build Flatpak # - name: Build Flatpak
uses: flathub-infra/flatpak-github-actions/flatpak-builder@23796715b3dfa4c86ddf50cf29c3cc8b3c82dca8 # uses: flathub-infra/flatpak-github-actions/flatpak-builder@23796715b3dfa4c86ddf50cf29c3cc8b3c82dca8
with: # with:
bundle: duckstation-x64.flatpak # bundle: duckstation-x64.flatpak
upload-artifact: false # upload-artifact: false
manifest-path: scripts/flatpak/org.duckstation.DuckStation.yaml # manifest-path: scripts/flatpak/org.duckstation.DuckStation.yaml
arch: x86_64 # arch: x86_64
build-bundle: true # build-bundle: true
verbose: true # verbose: true
mirror-screenshots-url: https://dl.flathub.org/media # mirror-screenshots-url: https://dl.flathub.org/media
branch: stable # branch: stable
cache: true # cache: true
restore-cache: true # restore-cache: true
cache-key: flatpak-x64-${{ hashFiles('scripts/flatpak/**/*.yaml') }} # cache-key: flatpak-x64-${{ hashFiles('scripts/flatpak/**/*.yaml') }}
- name: Push to Flathub stable # - name: Push to Flathub stable
if: github.ref == 'refs/heads/dev' # if: github.ref == 'refs/heads/dev'
uses: flathub-infra/flatpak-github-actions/flat-manager@b6c92176b7f578aedd80cac74cd8f0336f618e89 # uses: flathub-infra/flatpak-github-actions/flat-manager@b6c92176b7f578aedd80cac74cd8f0336f618e89
with: # with:
flat-manager-url: https://hub.flathub.org/ # flat-manager-url: https://hub.flathub.org/
repository: stable # repository: stable
token: ${{ secrets.FLATHUB_STABLE_TOKEN }} # token: ${{ secrets.FLATHUB_STABLE_TOKEN }}
build-log-url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} # build-log-url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
- name: Validate build # - name: Validate build
run: | # run: |
flatpak-builder-lint repo repo # flatpak-builder-lint repo repo
- name: Upload Flatpak # - name: Upload Flatpak
uses: actions/upload-artifact@v4.3.3 # uses: actions/upload-artifact@v4.3.3
with: # with:
name: "linux-flatpak" # name: "linux-flatpak"
path: "duckstation-x64.flatpak" # path: "duckstation-x64.flatpak"
# macos-build: # macos-build:
@ -402,9 +402,9 @@ jobs:
create-release: create-release:
# needs: [windows-build, windows-arm64-build, linux-build, linux-flatpak-build, macos-build] # needs: [windows-build, windows-arm64-build, linux-build, linux-flatpak-build, macos-build]
needs: [linux-build, linux-flatpak-build] needs: [linux-appimage]
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev' if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev'
steps: steps:
- name: Download Artifacts - name: Download Artifacts
uses: actions/download-artifact@v4.1.7 uses: actions/download-artifact@v4.1.7
@ -415,7 +415,7 @@ jobs:
run: find ./artifacts/ run: find ./artifacts/
- name: Create preview release - name: Create preview release
if: github.ref == 'refs/heads/master' if: github.ref == 'refs/heads/main'
uses: "marvinpinto/action-automatic-releases@latest" uses: "marvinpinto/action-automatic-releases@latest"
with: with:
repo_token: "${{ secrets.GITHUB_TOKEN }}" repo_token: "${{ secrets.GITHUB_TOKEN }}"
@ -423,13 +423,13 @@ jobs:
prerelease: true prerelease: true
title: "Latest Preview Build" title: "Latest Preview Build"
files: | files: |
./artifacts/windows/duckstation-windows-x64-release.zip # ./artifacts/windows/duckstation-windows-x64-release.zip
./artifacts/windows/duckstation-windows-x64-release-symbols.zip # ./artifacts/windows/duckstation-windows-x64-release-symbols.zip
./artifacts/windows-arm64/duckstation-windows-arm64-release.zip # ./artifacts/windows-arm64/duckstation-windows-arm64-release.zip
./artifacts/windows-arm64/duckstation-windows-arm64-release-symbols.zip # ./artifacts/windows-arm64/duckstation-windows-arm64-release-symbols.zip
./artifacts/linux-x64-appimage-qt/DuckStation-x64.AppImage ./artifacts/linux-x64-appimage-qt/DuckStation-x64.AppImage
./artifacts/linux-flatpak/duckstation-x64.flatpak # ./artifacts/linux-flatpak/duckstation-x64.flatpak
./artifacts/macos/duckstation-mac-release.zip # ./artifacts/macos/duckstation-mac-release.zip
- name: Create dev release - name: Create dev release
if: github.ref == 'refs/heads/dev' if: github.ref == 'refs/heads/dev'
@ -440,11 +440,11 @@ jobs:
prerelease: false prerelease: false
title: "Latest Rolling Release" title: "Latest Rolling Release"
files: | files: |
./artifacts/windows/duckstation-windows-x64-release.zip # ./artifacts/windows/duckstation-windows-x64-release.zip
./artifacts/windows/duckstation-windows-x64-release-symbols.zip # ./artifacts/windows/duckstation-windows-x64-release-symbols.zip
./artifacts/windows-arm64/duckstation-windows-arm64-release.zip # ./artifacts/windows-arm64/duckstation-windows-arm64-release.zip
./artifacts/windows-arm64/duckstation-windows-arm64-release-symbols.zip # ./artifacts/windows-arm64/duckstation-windows-arm64-release-symbols.zip
./artifacts/linux-x64-appimage-qt/DuckStation-x64.AppImage ./artifacts/linux-x64-appimage-qt/DuckStation-x64.AppImage
./artifacts/linux-flatpak/duckstation-x64.flatpak # ./artifacts/linux-flatpak/duckstation-x64.flatpak
./artifacts/macos/duckstation-mac-release.zip # ./artifacts/macos/duckstation-mac-release.zip

View file

@ -1,36 +0,0 @@
name: Upload Caches
on:
workflow_dispatch:
jobs:
upload-windows-cache:
runs-on: windows-2022
timeout-minutes: 120
steps:
- uses: actions/checkout@v4.1.6
with:
fetch-depth: 0
- name: Cache Dependencies
id: cache-deps
uses: actions/cache@v4.0.2
with:
path: |
dep/msvc/deps-arm64
dep/msvc/deps-x64
key: deps ${{ hashFiles('scripts/deps/build-dependencies-windows-arm64.bat', 'scripts/deps/build-dependencies-windows-x64.bat') }}
- name: Zip Cache Files
if: steps.cache-deps.outputs.cache-hit == 'true'
shell: cmd
run: |
"C:\Program Files\7-Zip\7z.exe" a -r deps-x64.zip ./dep/msvc/deps-x64
"C:\Program Files\7-Zip\7z.exe" a -r deps-arm64.zip ./dep/msvc/deps-arm64
- name: Upload Cache Files
if: steps.cache-deps.outputs.cache-hit == 'true'
uses: actions/upload-artifact@v4.3.3
with:
name: "windows"
path: "deps-*.zip"