Skip to content

Add TGS Version

Add TGS Version #79

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-latest
steps:
- name: apt-get update
run: sudo apt-get update
- name: Cache Reprepro .deb
uses: actions/cache@v3
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.4-1_amd64.deb -o /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@72b6676b71ab476b77e676928516f6982eef7a41 # v5.3.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"
git config user.email "[email protected]"
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: Push
run: |
cd $HOME/ppa
git push "https://${{ secrets.GH_PAGES_PUSH_TOKEN }}@github.com/tgstation/tgstation-ppa"