From 826ae425935c14138a9838b7d459d0afc3479be9 Mon Sep 17 00:00:00 2001 From: nosoop Date: Sun, 18 Sep 2022 03:48:28 -0700 Subject: [PATCH] build: Add build-on-release workflow --- .github/workflows/release.yml | 49 +++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..0a52ac0 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,49 @@ +# Builds when a release is published. +name: Release Build + +on: + release: + types: [published] + +jobs: + run: + name: Build Release Package + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Setup SourcePawn Compiler + uses: rumblefrog/setup-sp@v1.2.1 + with: + version: "1.10.x" + - name: Compile tf2attributes + run: spcomp scripting/tf2attributes.sp + - name: Upload Include + id: upload-release-include + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./scripting/include/tf2attributes.inc + asset_name: tf2attributes.inc + asset_content_type: text/plain + - name: Upload Plugin + id: upload-release-plugin + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./tf2attributes.smx + asset_name: tf2attributes.smx + asset_content_type: application/octet-stream + - name: Upload Game Config + id: upload-release-gamedata + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./gamedata/tf2.attributes.txt + asset_name: tf2.attributes.txt + asset_content_type: text/plain