Skip to content

Accept additional arguments in tag.sh #1

Accept additional arguments in tag.sh

Accept additional arguments in tag.sh #1

name: Build and release
# This workflow runs when any of the following occur:
# - A tag starting with "v" is created
on:
push:
tags:
- v*
# Used to run locally using https://github.com/nektos/act
env:
ACT:
NAME: fh2_reshade_presets
jobs:
# This pushes the zip to GitHub Packages.
build:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
#
steps:
- uses: actions/checkout@v4
- name: Set up (act)
if: ${{ env.ACT }}
run: |
apt-get update
apt-get install zip -y
- name: Read version
id: version
run: echo "version=$(cat ./VERSION)" >> "$GITHUB_OUTPUT"
# Builds dist/$NAME_<version>.zip
- name: Build package
run: bash scripts/pack.sh
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.NAME }}_${{ steps.version.outputs.version }}.zip
path: ./dist/${{ env.NAME }}_${{ steps.version.outputs.version }}.zip
if-no-files-found: error
outputs:
version: ${{ steps.version.outputs.version }}
# This creates a draft release.
release:
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: ${{ env.NAME }}_${{ needs.build.outputs.version }}.zip
- name: Publish release
uses: softprops/action-gh-release@v1
with:
name: Release ${{ needs.build.outputs.version}}
generate_release_notes: true
files: ${{ env.NAME }}_${{ needs.build.outputs.version }}.zip