Update goreleaser to v2, build with go1.22, update GH actions (#932) #71
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish NPM Package for Sysl | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- "ts/**" | |
- .github/workflows/npm-publish.yaml | |
jobs: | |
check-version: | |
runs-on: ${{ vars.RUNNER_UBUNTU && fromJSON(vars.RUNNER_UBUNTU) || 'ubuntu-latest' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
# This one-liner will exit 1 if the current version in package.json exists in the registry. | |
- name: Ensure new version | |
run: | | |
! npm view @anz-bank/sysl versions --json | grep "$(node -e 'console.log(require("./package.json").version)')" | |
working-directory: ts | |
env: | |
NPM_CONFIG_REGISTRY: ${{ vars.NPM_CONFIG_REGISTRY }} | |
publish: | |
needs: check-version | |
runs-on: ${{ vars.RUNNER_UBUNTU && fromJSON(vars.RUNNER_UBUNTU) || 'ubuntu-latest' }} | |
if: ${{ github.repository_owner == 'anz-bank' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
registry-url: "https://registry.npmjs.org" | |
always-auth: true | |
- name: Install Project | |
run: yarn install --frozen-lockfile | |
working-directory: ts | |
- name: Build | |
run: yarn build | |
working-directory: ts | |
- name: Publish Package | |
run: yarn publish | |
working-directory: ts/dist | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |