Skip to content

Commit

Permalink
feat: create GitHub release (#15)
Browse files Browse the repository at this point in the history
Added GitHub plugin to automatically create a GitHub release from a tag.

Solves PZ-1037
  • Loading branch information
edgarvonk authored Dec 14, 2023
1 parent 971badc commit c8d86f1
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion .github/workflows/build-test-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ jobs:
next-version:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get-version.outputs.replaced }}
tag: ${{ steps.get-tag.outputs.new_tag }}
steps:
# Checkout the repository including tags
- name: Checkout
Expand All @@ -69,6 +72,10 @@ jobs:
pattern: 'v(.*)'
string: ${{ steps.get-tag.outputs.new_tag }}
replace-with: '$1'
- name: Print new tag and version
run: |
echo "Next version: ${{ steps.get-version.outputs.replaced }}"
echo "Next version tag: ${{ steps.get-tag.outputs.new_tag }}"
publish:
needs: [build, next-version]
Expand Down Expand Up @@ -97,4 +104,28 @@ jobs:
with:
arguments: publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

create-release:
needs: [next-version, publish]
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
env:
NEXT_VERSION: ${{ needs.next-version.outputs.version }}
NEXT_VERSION_TAG: ${{ needs.next-version.outputs.tag }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create or update GitHub release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ env.NEXT_VERSION_TAG }}
name: ${{ env.APPLICATION_NAME }} ${{ env.NEXT_VERSION }}
draft: false
prerelease: false
allowUpdates: true
makeLatest: true
generateReleaseNotes: true

0 comments on commit c8d86f1

Please sign in to comment.