mirror of
https://github.com/openziti/zrok.git
synced 2025-06-24 03:31:57 +02:00
CI for the zrok NodeJS SDK
This commit is contained in:
parent
9f071f5ec6
commit
5ee69d96b6
40
.github/workflows/node-sdk.yml
vendored
40
.github/workflows/node-sdk.yml
vendored
@ -27,7 +27,7 @@ jobs:
|
|||||||
- { os: ubuntu-20.04, target: "linux", arch: "x64" }
|
- { os: ubuntu-20.04, target: "linux", arch: "x64" }
|
||||||
node_ver: [ 20 ]
|
node_ver: [ 20 ]
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Node Version
|
- name: Node Version
|
||||||
@ -41,19 +41,25 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
submodules: 'recursive'
|
submodules: 'recursive'
|
||||||
|
|
||||||
- name: Bump semver
|
- name: Get current zrok repo tag
|
||||||
if: github.ref == 'refs/heads/main'
|
id: tag
|
||||||
uses: TriPSs/conventional-changelog-action@v3
|
run: echo ::set-output name=TAG::$(git describe --tags --abbrev=0)
|
||||||
with:
|
|
||||||
github-token: ${{ secrets.GH_ACTION }}
|
|
||||||
git-message: 'chore(release): {version}'
|
|
||||||
preset: 'angular'
|
|
||||||
tag-prefix: 'v'
|
|
||||||
output-file: 'CHANGELOG.md'
|
|
||||||
skip-on-empty: true # do not alter semver when we push 'chore: ...' commits
|
|
||||||
release-count: 0 # ensure changelog is generated to contain ALL updates
|
|
||||||
|
|
||||||
- name: Pull newly bumped semver
|
- name: Update zrok NodeJS-SDK's package.json version based on current zrok repo git tag
|
||||||
|
run: |
|
||||||
|
cd ${{ runner.workspace }}/${{ github.event.repository.name }}/sdk/nodejs/sdk
|
||||||
|
npm version ${{ steps.tag.outputs.TAG }} --no-git-tag-version --allow-same-version
|
||||||
|
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
git config --global user.name "github-actions[bot]"
|
||||||
|
git commit -am "Update package.json version to ${{ steps.tag.outputs.TAG }}" || echo "No changes to commit"
|
||||||
|
|
||||||
|
- name: Push changes to zrok NodeJS-SDK's package.json
|
||||||
|
uses: ad-m/github-push-action@master
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
branch: ${{ github.ref }}
|
||||||
|
|
||||||
|
- name: Pull newly bumped zrok NodeJS-SDK semver
|
||||||
if: github.ref == 'refs/heads/main'
|
if: github.ref == 'refs/heads/main'
|
||||||
run: git pull
|
run: git pull
|
||||||
|
|
||||||
@ -65,7 +71,7 @@ jobs:
|
|||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
registry-url: 'https://registry.npmjs.org'
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
|
||||||
- name: Build NodeJS-SDK
|
- name: Build the zrok NodeJS-SDK
|
||||||
run: |
|
run: |
|
||||||
cd ${{ runner.workspace }}/${{ github.event.repository.name }}/sdk/nodejs/sdk
|
cd ${{ runner.workspace }}/${{ github.event.repository.name }}/sdk/nodejs/sdk
|
||||||
npm install
|
npm install
|
||||||
@ -75,7 +81,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Publish production release
|
- name: Publish production release
|
||||||
if: github.ref == 'refs/heads/main'
|
if: github.ref == 'refs/heads/main'
|
||||||
run: npm publish --access public
|
run: |
|
||||||
|
cd ${{ runner.workspace }}/${{ github.event.repository.name }}/sdk/nodejs/sdk
|
||||||
|
npm publish --access public
|
||||||
env:
|
env:
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
|
||||||
@ -85,4 +93,4 @@ jobs:
|
|||||||
token: ${{ secrets.NPM_TOKEN }}
|
token: ${{ secrets.NPM_TOKEN }}
|
||||||
access: public
|
access: public
|
||||||
if: |
|
if: |
|
||||||
startsWith(github.ref, 'refs/tags/')
|
startsWith(github.ref, 'refs/tags/')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user