Skip to content

Commit

Permalink
Add workflow to build on release
Browse files Browse the repository at this point in the history
Attempt 1
  • Loading branch information
nosoop committed Nov 15, 2021
1 parent e40317f commit 970d13b
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/build-on-version-tag-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Builds when a release is published.
name: Build Workflow

on:
release:
types: [published]

jobs:
run:
name: Build Release Package
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v1
with:
submodules: true

- name: Setup SourcePawn Compiler
uses: rumblefrog/setup-sp@master
with:
version: "1.10.x"

- name: Setup Ninja Build
uses: ashutoshvarma/setup-ninja@master
with:
version: 1.10.0

- name: Build Files
run: |
python3 configure.py
ninja
- 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 }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./build/scripting/include/tf2utils.inc
asset_name: tf2utils.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 }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./build/plugins/tf2utils.smx
asset_name: tf2utils.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 }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./build/gamedata/tf2.utils.nosoop.txt
asset_name: tf2.utils.nosoop.txt
asset_content_type: text/plain

0 comments on commit 970d13b

Please sign in to comment.