From 5f67a8f51aac0d741a361b8768f9812d41bda6a4 Mon Sep 17 00:00:00 2001 From: Joshua Fish Date: Thu, 13 Jul 2023 16:28:47 +1000 Subject: [PATCH] main branch with release workflow --- .github/workflows/release.yml | 50 +++++++++++++++++++++++++++++++++++ 1 file changed, 50 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..bd94205 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,50 @@ +name: Create Release +on: + workflow_dispatch: + inputs: + releaseType: + description: Create a draft release + required: true + type: boolean + default: true + push: + branches: + - main +concurrency: + group: release + cancel-in-progress: false +run-name: Release ${{ github.sha }} by @${{ github.actor }} +permissions: + contents: write + id-token: write + pull-requests: read +jobs: + get-version: + runs-on: ubuntu-latest + outputs: + version: ${{ steps.get-version.outputs.version }} + steps: + - uses: actions/checkout@v3 + - name: Get Release Version + id: get-version + uses: nullify-platform/github-actions/actions/release-version@main + - run: | + echo "config-file-parser @ ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY + echo "VERSION: ${{ steps.get-version.outputs.version }}" >> $GITHUB_STEP_SUMMARY + echo "SHORT_SHA: $(git rev-parse --short HEAD)" >> $GITHUB_STEP_SUMMARY + release: + if: ${{ needs.get-version.outputs.version != 'undefined' || (github.event_name == 'workflow_dispatch' && needs.get-version.outputs.version != 'undefined') }} + runs-on: ubuntu-latest + needs: [ get-version ] + steps: + - uses: actions/checkout@v3 + - name: Generate Release Tag + run: echo "RELEASE_TAG=v${{ needs.get-version.outputs.version }}" >> $GITHUB_ENV + - name: Generate Release + uses: softprops/action-gh-release@v1 + with: + draft: false + generate_release_notes: true + append_body: true + tag_name: ${{ env.RELEASE_TAG }} + token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file