chore(release): v0.24.1 (#167) #127
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: Release | |
on: | |
push: | |
branches: | |
- main | |
- next | |
jobs: | |
test-nodejs: | |
# We just check the message of first commit as there is always just one commit because we squash into one before merging | |
# "commits" contains array of objects where one of the properties is commit "message" | |
# Release workflow will be skipped if release conventional commits are not used | |
if: | | |
startsWith( github.repository, 'the-codegen-project/' ) && | |
(startsWith( github.event.commits[0].message , 'fix' ) || | |
startsWith( github.event.commits[0].message, 'feat' )) | |
name: Test NodeJS release on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows | |
run: | | |
git config --global core.autocrlf false | |
git config --global core.eol lf | |
shell: bash | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Check package-lock version | |
uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master | |
id: lockversion | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "${{ steps.lockversion.outputs.version }}" | |
- if: steps.lockversion.outputs.version == '18' && matrix.os == 'windows-latest' | |
name: Install npm cli 8 | |
shell: bash | |
#npm cli 10 is buggy because of some cache issues | |
run: npm install -g [email protected] | |
- name: Install dependencies | |
shell: bash | |
run: npm ci | |
- name: Run test | |
run: npm test --if-present | |
release: | |
needs: [test-nodejs] | |
name: Publish to any of NPM, Github, or Docker Hub | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows | |
run: | | |
git config --global core.autocrlf false | |
git config --global core.eol lf | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Check package-lock version | |
uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master | |
id: lockversion | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "${{ steps.lockversion.outputs.version }}" | |
- name: Install dependencies | |
shell: bash | |
run: npm ci | |
- name: Add plugin for conventional commits for semantic-release | |
run: npm install --save-dev [email protected] | |
- name: Publish to any of NPM and Github | |
id: release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GIT_AUTHOR_NAME: jonaslagoni | |
GIT_AUTHOR_EMAIL: [email protected] | |
GIT_COMMITTER_NAME: jonaslagoni | |
GIT_COMMITTER_EMAIL: [email protected] | |
run: npx [email protected] |