From 751b64652b45fe710fe0b9b2662d5c1ef9f18291 Mon Sep 17 00:00:00 2001 From: Guilherme Branco Stracini Date: Sat, 14 Sep 2024 17:30:04 +0100 Subject: [PATCH] Create create-release.yml (#15) --- .github/workflows/create-release.yml | 66 ++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 .github/workflows/create-release.yml diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml new file mode 100644 index 0000000..def2eae --- /dev/null +++ b/.github/workflows/create-release.yml @@ -0,0 +1,66 @@ +name: Create Release + +on: + pull_request: + branches: + - main + push: + branches: + - main + +permissions: + contents: write + +jobs: + + # test-action: + # name: GitHub Actions Test + # runs-on: ubuntu-latest + + # steps: + # - name: Checkout + # id: checkout + # uses: actions/checkout@v4 + + # - name: Test Local Action + # id: test-action + # uses: ./ + + # - name: Print Output + # id: output + # run: echo "${{ steps.test-action.outputs.time }}" + + create-release: + name: Create release + # needs: [test-typescript, test-action] + runs-on: ubuntu-latest + if: github.event_name != 'pull_request' + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install GitVersion + uses: gittools/actions/gitversion/setup@v2 + with: + versionSpec: '5.x' + + - name: Determine Version + id: gitversion + uses: gittools/actions/gitversion/execute@v2 + with: + useConfigFile: true + + - name: Create Release + uses: ncipollo/release-action@v1.14.0 + with: + allowUpdates: false + skipIfReleaseExists: true + draft: false + makeLatest: true + tag: v${{ steps.gitversion.outputs.semVer }} + name: Release v${{ steps.gitversion.outputs.semVer }} + generateReleaseNotes: true + body: + Release ${{ steps.gitversion.outputs.semVer }} of ${{ github.event.repository.name }}