Add TGS Version #117
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Add TGS Version | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| tgs_semver: | |
| description: 'TGS Version' | |
| required: true | |
| type: string | |
| concurrency: | |
| group: "package-update" | |
| cancel-in-progress: false | |
| jobs: | |
| add_tgs_version: | |
| name: Add TGS Version | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Install Native Dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y curl reprepro git gnupg2 procps xz-utils | |
| - name: Initialize gpg-agent | |
| uses: crazy-max/ghaction-import-gpg@cb9bde2e2525e640591a934b1fd28eef1dcaf5e5 # v6.2.0 | |
| with: | |
| gpg_private_key: ${{ secrets.REPO_PRIVATE_KEY }} | |
| passphrase: ${{ secrets.REPO_PRIVATE_KEY_PASSPHRASE }} | |
| - name: Clone gh-pages | |
| run: git clone -b gh-pages --single-branch "https://git@github.com/tgstation/tgstation-ppa" $HOME/ppa | |
| - name: Download and Extract TGS Debian Packaging Bundle | |
| run: | | |
| cd $HOME | |
| curl -L https://github.com/tgstation/tgstation-server/releases/download/tgstation-server-v${{ github.event.inputs.tgs_semver }}/tgstation-server-v${{ github.event.inputs.tgs_semver }}.debian.packaging.tar.xz -o tgstation-server-v${{ github.event.inputs.tgs_semver }}.debian.packaging.tar.xz | |
| tar -xvf tgstation-server-v${{ github.event.inputs.tgs_semver }}.debian.packaging.tar.xz | |
| - name: Run reprepro include | |
| run: | | |
| cd $HOME/ppa/debian | |
| reprepro include unstable $HOME/tgstation-server_${{ github.event.inputs.tgs_semver }}-1_amd64.changes | |
| - name: Commit | |
| run: | | |
| cd $HOME/ppa | |
| git config user.name "tgstation-server-ci[bot]" | |
| git config user.email "161980869+tgstation-server-ci[bot]@users.noreply.github.com" | |
| echo '# THIS BRANCH IS AUTO GENERATED BY GITHUB ACTIONS' > README.md | |
| git add --all | |
| git diff-index --quiet HEAD || git commit -m "Update repository for workflow run ${{ github.run_number }}" -m "TGS Version: ${{ github.event.inputs.tgs_semver }}" | |
| - name: Generate App Token | |
| id: app-token-generation | |
| uses: actions/create-github-app-token@v1 | |
| with: | |
| app-id: ${{ secrets.APP_ID }} | |
| private-key: ${{ secrets.APP_PRIVATE_KEY }} | |
| - name: Push | |
| run: | | |
| cd $HOME/ppa | |
| git push "https://tgstation-server-ci:${{ steps.app-token-generation.outputs.token }}@github.com/tgstation/tgstation-ppa" |