Skip to content

[CICD-817] Site Deploy Release (#102) #37

[CICD-817] Site Deploy Release (#102)

[CICD-817] Site Deploy Release (#102) #37

Workflow file for this run

name: Version and Release
on:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
versioning:
name: Versioning
runs-on: ubuntu-latest
outputs:
hasChangesets: ${{ steps.changesets.outputs.hasChangesets }}
version: ${{ steps.version.outputs.CURRENT_VERSION }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Setup Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Install Dependencies
run: npm ci
- name: Create Release Pull Request
id: changesets
uses: changesets/action@v1
with:
commit: "Version Action"
title: "Version Action"
version: npm run version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get current version
id: version
run: echo "CURRENT_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
release:
name: Release
runs-on: ubuntu-latest
needs: versioning
if: needs.versioning.outputs.hasChangesets == 'false'
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure git
run: |
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
- name: Setup Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Publish tags
id: publish
uses: ./.github/actions/publish
with:
version: ${{ needs.versioning.outputs.version }}
- name: Get release notes
id: notes
if: steps.publish.outputs.published == 'true'
uses: ./.github/actions/get-release-notes
with:
version: ${{ needs.versioning.outputs.version }}
changelog: ./CHANGELOG.md
- name: Create release
if: steps.notes.outputs.release_notes
uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5
with:
body: ${{ steps.notes.outputs.release_notes }}
tag_name: v${{ needs.versioning.outputs.version }}