Skip to content

Commit

Permalink
feat(GH-8): Update release workflow and remove preview
Browse files Browse the repository at this point in the history
  • Loading branch information
gavanlamb committed Jun 16, 2024
1 parent 9890375 commit 393195e
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 126 deletions.
113 changes: 0 additions & 113 deletions .github/workflows/preview.yml

This file was deleted.

59 changes: 46 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: 'Preview'
name: 'Release'

on:
pull_request:
push:
branches:
- main
Expand All @@ -13,6 +14,8 @@ jobs:
build:
name: Build
runs-on: ubuntu-latest
outputs:
sem-ver: ${{ steps.get-version.outputs.semVer }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -40,9 +43,6 @@ jobs:
env:
BUILD_NUMBER: ${{ github.run_number }}

- name: Set version
run: npm version ${{ steps.get-version.outputs.semVer }}

- name: Restore dependencies
run: npm ci

Expand All @@ -59,23 +59,56 @@ jobs:
files: |
./test-results/junit.xml
- name: Publish test coverage
uses: ArtiomTr/jest-coverage-report-action@v2
if: always()
with:
skip-step: all
coverage-file: ./test-results/summary.json
base-coverage-file: ./test-results/summary.json

- name: Package
run: npm run package

- name: Verify changed files
uses: tj-actions/verify-changed-files@v20
id: verify-changed-files
with:
fail-if-changed: true
fail-message: Files in the dist folder are not up-to-date. Please run 'npm run package' locally and commit the changes.
files: |
dist
- name: Qodana Scan
uses: JetBrains/qodana-action@v2024.1
env:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
use-annotations: true

release:
name: release
name: Release
runs-on: ubuntu-latest
needs:
- build
env:
tag: v${{ needs.build.outputs.sem-ver }}
environment: Production
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Create and push tag
run: |
git config user.name '${{ github.actor }}'
git config user.email '${{ github.actor }}@users.noreply.github.com'
git remote set-url origin https://${{ github.actor }}:${{ github.token }}@github.com/${{ github.repository }}
git tag -a ${{ env.tag }} -m "${{ env.tag }}}"
git push origin tag ${{ env.tag }}
- name: Create release notes
uses: mikepenz/release-changelog-builder-action@v5.0.0-a02
id: create-release-notes
with:
configuration: release-notes-config.yml
failOnError: false
toTag: ${{ github.sha }}
token: ${{ github.token }}
- name: Create release
uses: softprops/action-gh-release@v2
with:
body: ${{ steps.build-release-notes.outputs.changelog }}
tag_name: ${{ env.tag }}
make_latest: true

0 comments on commit 393195e

Please sign in to comment.