Skip to content

Commit

Permalink
feat(GH-8): Update release and preview workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
gavanlamb committed Jun 14, 2024
1 parent 331e1a5 commit 4acd887
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

concurrency:
cancel-in-progress: false
group: preview-${{ github.ref_name }}
group: release-${{ github.ref_name }}

jobs:
build:
Expand All @@ -23,6 +23,10 @@ jobs:
with:
node-version-file: .node-version

- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v1.1.1
with:
versionSpec: '5.x'
- name: Get version
id: get-version
uses: gittools/actions/gitversion/execute@v1.1.1
Expand Down
31 changes: 18 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: 'Preview'

on:
pull_request:
push:
branches:
- main

concurrency:
cancel-in-progress: false
Expand All @@ -23,27 +25,32 @@ jobs:
with:
node-version-file: .node-version

- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v1.1.1
with:
versionSpec: '5.x'
- name: Get version
uses: gavanlamb/github-actions/.github/actions/version/get@main
id: get-version
uses: gittools/actions/gitversion/execute@v1.1.1
with:
targetPath: ./
disableCache: true
useConfigFile: true
configFilePath: GitVersion.yml
env:
BUILD_NUMBER: ${{ github.run_number }}

- name: Set version
run: |
npm version --no-git-tag-version --allow-same-version ${{ steps.get-version.outputs.sem-ver }}
run: npm version --no-git-tag-version --allow-same-version ${{ steps.get-version.outputs.semVer }}

- name: Restore dependencies
run: |
npm ci
run: npm ci

- name: Lint
run: |
npm run lint
run: npm run lint

- name: Test
run: |
npm run test
run: npm run test

- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v2
Expand All @@ -59,8 +66,6 @@ jobs:
skip-step: all
coverage-file: ./test-results/summary.json
base-coverage-file: ./test-results/summary.json
prnumber: ${{ github.event.pull_request.number }}

- name: Package
run: |
npm run package
run: npm run package

0 comments on commit 4acd887

Please sign in to comment.