From e1da13c89a878e6af7998b75f57773cf82c2fbcc Mon Sep 17 00:00:00 2001 From: Bassem Dghaidi <568794+Link-@users.noreply.github.com> Date: Sat, 14 Oct 2023 17:10:46 +0200 Subject: [PATCH] Fix release workflow --- .github/release.yaml | 22 ++++++++++++++++++++++ .github/workflows/release.yaml | 31 ++++++++++++++++++++++++++----- 2 files changed, 48 insertions(+), 5 deletions(-) create mode 100644 .github/release.yaml diff --git a/.github/release.yaml b/.github/release.yaml new file mode 100644 index 0000000..1a67b68 --- /dev/null +++ b/.github/release.yaml @@ -0,0 +1,22 @@ +# .github/release.yml + +changelog: + exclude: + labels: + - ignore-for-release + categories: + - title: Breaking Changes 🛠 + labels: + - breaking-change + - title: Exciting New Features 🎉 + labels: + - enhancement + - title: Bug Fixes 🐛 + labels: + - bug + - title: Chores + labels: + - dependencies + - title: Other Changes + labels: + - "*" \ No newline at end of file diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 305514c..889ceb6 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -8,6 +8,9 @@ on: description: 'Release version' required: true +permissions: + contents: write + jobs: build-and-release: runs-on: ubuntu-latest @@ -22,7 +25,7 @@ jobs: - name: Install dependencies run: | - npm install + npm ci - name: Build package run: | @@ -32,22 +35,40 @@ jobs: uses: EndBug/add-and-commit@a3adef035a1381dcf888c90b847240e2ddb9e008 with: author_name: Link- - author_email: bassem@interop.link + author_email: 568794+Link-@users.noreply.github.com message: 'Update build' add: 'bin/starred_search' - name: Update version run: | - npm version ${{ github.event.inputs.name }} + npm version ${{ github.event.inputs.version }} - - name: Push new version and tag + - name: Push package.json uses: EndBug/add-and-commit@a3adef035a1381dcf888c90b847240e2ddb9e008 with: author_name: Link- - author_email: bassem@interop.link + author_email: 568794+Link-@users.noreply.github.com message: 'Update version' add: 'package.json' + - name: Tag version + run: | + git tag ${{ github.event.inputs.version }} + + - name: Push tag + uses: EndBug/add-and-commit@a3adef035a1381dcf888c90b847240e2ddb9e008 + with: + author_name: Link- + author_email: 568794+Link-@users.noreply.github.com + + - uses: actions/create-release@master + name: Create ${{ github.event.inputs.version }} Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: "${{ github.event.inputs.version }}" + release_name: "${{ github.event.inputs.version }}" + - name: Release uses: JS-DevTools/npm-publish@0f451a94170d1699fd50710966d48fb26194d939 with: