Skip to content

Instantly share code, notes, and snippets.

@gesslar
Created June 20, 2024 21:50
Show Gist options
  • Save gesslar/ae50e2f31efdf9d350f8fb3f93f1306e to your computer and use it in GitHub Desktop.
Save gesslar/ae50e2f31efdf9d350f8fb3f93f1306e to your computer and use it in GitHub Desktop.
GitHub workflow for automatically compiling and creating a release whenever you push to GitHub, except from PRs
name: Build project using muddler and upload artifact
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/[email protected]
- name: JSON to variables
# see https://github.com/antifree/json-to-variables
# You may pin to the exact commit or the version.
# uses: antifree/json-to-variables@cc8c6394031e145c90f7f9ec909d83df92431fb8
uses: antifree/[email protected]
with:
# The json file.
filename: "./mfile"
# The prefix for variables.
prefix: "mfile"
- name: "create version.txt"
uses: 1arp/[email protected]
# see https://github.com/marketplace/actions/create-a-file
with:
path: './'
isAbsolutePath: false
file: 'version.txt'
content: ${{ env.mfile_version }}
- name: Build With Muddler
# You may pin to the exact commit or the version.
# uses: demonnic/build-with-muddler@a9355b3c4f93553287e0f2d4087508b9f6164225
uses: demonnic/[email protected]
with:
# Version of muddler to use
muddlerVersion: LATEST # optional, default is LATEST
# What directory to run muddler in.
#workingDir: # optional, default is ${{ github.workspace }}
- uses: ncipollo/release-action@v1
# see https://github.com/marketplace/actions/create-release
with:
artifacts: "build/${{env.mfile_package}}.mpackage,version.txt"
allowUpdates: true
bodyFile: "./README.md"
tag: ${{ env.mfile_version }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment