Skip to content

Commit

Permalink
➕ connorjs/github-workflows, use npm-ci-build
Browse files Browse the repository at this point in the history
Replaces in-repo CI Build job with `npm-ci-build@v1` from
`connorjs/github-worfklows`. Applies other changes to match published
style conventions from that repo.
  • Loading branch information
connorjs committed Aug 5, 2024
1 parent bf68221 commit 3e445f9
Showing 1 changed file with 13 additions and 44 deletions.
57 changes: 13 additions & 44 deletions .github/workflows/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,12 @@ on:
branches: [main]

jobs:
Build:
name: Build
runs-on: ubuntu-latest
outputs:
GitVersion_SemVer: ${{ steps.GitVersion.outputs.GitVersion_SemVer }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Full depth (not shallow) for GitVersion and better relevancy of Sonar analysis
ci-build:
uses: connorjs/github-workflows/.github/workflows/[email protected]
with:
project-type: fail-for-testing

- name: Set up GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: 6.x

- name: Execute GitVersion
id: GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
overrideConfig: |
workflow=GitHubFlow/v1
mode=ContinuousDeployment
- name: Use Node.js
uses: actions/setup-node@v4
with:
cache: npm
node-version-file: .node-version

- name: Install
run: npm ci

- name: CI build
run: npm run ci-build

Test:
pipeline-tests:
name: Test (${{ matrix.node }} | ${{ matrix.platform.os }})
defaults:
run:
Expand Down Expand Up @@ -123,15 +92,15 @@ jobs:
run: |
scripts/test.sh foo custom-config-path.config.mjs '-c .config/custom-config-path.config.mjs'
Publish:
if: ${{ github.ref == 'refs/heads/main' }}
publish:
name: Publish
if: ${{ github.ref == 'refs/heads/main' }}
needs:
- Build # For version variable
- Test # Requires passing tests
- ci-build # For version variable
- pipeline-tests # Requires passing tests
runs-on: ubuntu-latest
env:
GitVersion_SemVer: ${{needs.Build.outputs.GitVersion_SemVer}}
semVer: ${{needs.ci-build.outputs.semVer}}
permissions:
contents: write
id-token: write
Expand All @@ -145,7 +114,7 @@ jobs:
registry-url: https://registry.npmjs.org

- name: Set version
run: sed -i 's/0.0.0-gitversion/${{ env.GitVersion_SemVer }}/g' package.json
run: sed -i 's/0.0.0-gitversion/${{ env.semVer }}/g' package.json

- name: Install
run: npm install
Expand All @@ -157,5 +126,5 @@ jobs:

- name: git tag
run: |
git tag v${{ env.GitVersion_SemVer }}
git push origin tag v${{ env.GitVersion_SemVer }}
git tag v${{ env.semVer }}
git push origin tag v${{ env.semVer }}

0 comments on commit 3e445f9

Please sign in to comment.