From 5d37e9a4f78534770262f6563eb1cc4b1f54ea8f Mon Sep 17 00:00:00 2001 From: Luke Hagar Date: Sat, 2 Mar 2024 11:56:18 -0500 Subject: [PATCH] Adding release action --- .github/workflows/release.yaml | 55 ++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..59fffb8 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,55 @@ +name: Release GitHub Action + +on: + push: + branches: + - main + workflow_dispatch: + +permissions: + # Give the default GITHUB_TOKEN write permission to commit and push the + # added or changed files to the repository. + contents: write + +jobs: + release: + runs-on: ubuntu-latest + concurrency: + group: release-action + cancel-in-progress: true + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v2 + with: + node-version: "20" + + - name: Run install + uses: borales/actions-yarn@v5 + with: + cmd: install + + - name: Run build + uses: borales/actions-yarn@v5 + with: + cmd: build + + - name: Get package info + id: package-info + uses: luizfelipelaviola/get-package-info@v1 + with: + path: . + + - name: Build Changelog + id: github_release + uses: mikepenz/release-changelog-builder-action@v4 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Publish or Update Draft Release + run: | + gh release create --draft ${{ steps.package-info.outputs.version }} --title "Release ${{ steps.package-info.outputs.version }}" --notes "${{ steps.github_release.outputs.changelog }}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - uses: stefanzweifel/git-auto-commit-action@v5