Skip to content

Create a new tag and release by @domengabrovsek #3

Create a new tag and release by @domengabrovsek

Create a new tag and release by @domengabrovsek #3

Workflow file for this run

name: Create new tag and release
run-name: Create a new tag and release by @${{ github.actor }}
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
permissions:
id-token: write # This is required for requesting the JWT
contents: write # This is required for actions/checkout
on:
pull_request:
types:
- closed
branches:
- master
jobs:
release-and-deploy:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history to compute release notes
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: "18"
- name: Install dependencies
run: npm ci
- name: Determine next version
id: next_version
run: echo "::set-output name=version::$(node .github/workflows/scripts/compute-version.js)"
- name: Print computed version
run: echo "Computed version is ${{ steps.next_version.outputs.version }}"
- name: Setup git user
run: |
git config --global user.name "github_action"
git config --global user.email "github_action@test.com"
- name: Update package.json with new version
run: npm version ${{ steps.next_version.outputs.version }} -m "Bump version to ${{ steps.next_version.outputs.version }}"
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
add: package.json
message: "chore: Bumped version in package.json"
default_author: github_actions
- name: Push changes
run: |
git push origin --tags
git push origin
- name: Create release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
prerelease: false
tag_name: v${{ steps.next_version.outputs.version }}