CI: add source packing when doing a release (#6146)

This commit is contained in:
liushuyu 2022-10-12 20:03:32 -06:00 committed by GitHub
parent e24e2a8f8b
commit 1759e2afc2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 1 deletions

16
.ci/source/build.sh Executable file
View file

@ -0,0 +1,16 @@
#!/bin/bash -ex
. .ci/common/pre-upload.sh
REV_NAME="citra-unified-source-${GITDATE}-${GITREV}"
COMPAT_LIST='dist/compatibility_list/compatibility_list.json'
pip3 install git-archive-all
wget -q https://api.citra-emu.org/gamedb -O "${COMPAT_LIST}"
git describe --abbrev=0 --always HEAD > GIT-COMMIT
git describe --tags HEAD > GIT-TAG || echo 'unknown' > GIT-TAG
git archive-all --include "${COMPAT_LIST}" --include GIT-COMMIT --include GIT-TAG --force-submodules artifacts/"${REV_NAME}.tar"
cd artifacts/
xz -T0 -9 "${REV_NAME}.tar"
sha256sum "${REV_NAME}.tar.xz" > "${REV_NAME}.tar.xz.sha256sum"
cd ..

View file

@ -58,6 +58,20 @@ jobs:
with: with:
name: ${{ matrix.image }} name: ${{ matrix.image }}
path: artifacts/ path: artifacts/
source:
if: ${{ !github.head_ref }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Pack
run: ./.ci/source/build.sh
- name: Upload
uses: actions/upload-artifact@v3
with:
name: source
path: artifacts/
macos: macos:
runs-on: macos-latest runs-on: macos-latest
steps: steps:
@ -154,7 +168,7 @@ jobs:
TRANSIFEX_API_TOKEN: ${{ secrets.TRANSIFEX_API_TOKEN }} TRANSIFEX_API_TOKEN: ${{ secrets.TRANSIFEX_API_TOKEN }}
release: release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [build, android] needs: [build, android, macos, source]
if: ${{ startsWith(github.ref, 'refs/tags/') }} if: ${{ startsWith(github.ref, 'refs/tags/') }}
steps: steps:
- uses: actions/download-artifact@v3 - uses: actions/download-artifact@v3