| name: Build a tarball | |
| on: | |
| push: | |
| tags: | |
| - v[0-9]+.[0-9]+.[0-9]+ | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: The version to build the tarball for | |
| required: true | |
| jobs: | |
| BuildTarball: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Determine version to build | |
| id: get-version | |
| run: | | |
| if ${{ github.event_name == 'push' }}; then | |
| version="$( echo '${{ github.ref }}' | sed 's@^refs/tags/v@@' )" | |
| else | |
| version='${{ inputs.version }}' | |
| fi | |
| # assert it's a version number | |
| set -x | |
| [[ ${version} =~ ^[0-9]+.[0-9]+.[0-9]+$ ]] && echo "version=${version}" >> $GITHUB_OUTPUT | |
| - name: Import GPG key | |
| uses: crazy-max/ghaction-import-gpg@v6 | |
| with: | |
| gpg_private_key: ${{ secrets.MIR_BOT_GPG_PRIVATE_KEY }} | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: v${{ steps.get-version.outputs.version }} | |
| - name: Build the tarball | |
| run: | | |
| ./tools/make_release_tarball --skip-checks | |
| gpg --detach-sig --sign --output wlcs-${{ steps.get-version.outputs.version }}.tar.xz.asc wlcs-${{ steps.get-version.outputs.version }}.tar.xz | |
| - name: Store the tarball and signature | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wlcs-${{ steps.get-version.outputs.version }} | |
| path: | | |
| wlcs-${{ steps.get-version.outputs.version }}.tar.xz | |
| wlcs-${{ steps.get-version.outputs.version }}.tar.xz.asc |