From 1759e2afc2b966e79d7cff5bc3ff848d43b74ae2 Mon Sep 17 00:00:00 2001 From: liushuyu Date: Wed, 12 Oct 2022 20:03:32 -0600 Subject: [PATCH] CI: add source packing when doing a release (#6146) --- .ci/source/build.sh | 16 ++++++++++++++++ .github/workflows/ci.yml | 16 +++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100755 .ci/source/build.sh diff --git a/.ci/source/build.sh b/.ci/source/build.sh new file mode 100755 index 000000000..fb212cb98 --- /dev/null +++ b/.ci/source/build.sh @@ -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 .. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7d97607ae..a829b2a20 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,6 +58,20 @@ jobs: with: name: ${{ matrix.image }} 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: runs-on: macos-latest steps: @@ -154,7 +168,7 @@ jobs: TRANSIFEX_API_TOKEN: ${{ secrets.TRANSIFEX_API_TOKEN }} release: runs-on: ubuntu-latest - needs: [build, android] + needs: [build, android, macos, source] if: ${{ startsWith(github.ref, 'refs/tags/') }} steps: - uses: actions/download-artifact@v3