Skip to content

Add TGS Version

Add TGS Version #102

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: apt-get update
run: sudo apt-get update
- name: Cache Reprepro .deb
uses: actions/cache@v4
id: cache-reprepro
with:
path: /reprepro-deb-cache
key: reprepro-deb
- name: Download Reprepro .deb # TODO: Install reprepro from apt once 5.4.1 migrates to ubuntu from debian. The direct link has been known to 404 on updates
if: steps.cache-reprepro.outputs.cache-hit != 'true'
run: |
sudo apt-get install -y curl
sudo mkdir /reprepro-deb-cache
sudo curl -L https://deb.debian.org/debian/pool/main/r/reprepro/reprepro_5.4.5-1_amd64.deb -o /reprepro-deb-cache/reprepro.deb
- name: Run file on .deb
run: file /reprepro-deb-cache/reprepro.deb
- name: Install Reprepro
run: |
sudo apt-get install -y git gnupg2 procps xz-utils /reprepro-deb-cache/reprepro.deb
- 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://[email protected]/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"