Node workflow - Add version to commit, simplify cmake commands (#514)
This commit is contained in:
4
.github/workflows/node-ci.yml
vendored
4
.github/workflows/node-ci.yml
vendored
@@ -167,12 +167,12 @@ jobs:
|
||||
- name: CMake
|
||||
if: runner.os == 'MacOS'
|
||||
run: |
|
||||
cmake . -B build -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=${{ env.BUILDTYPE }} -DMBGL_WITH_COVERAGE=ON
|
||||
cmake . -B build -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=${{ env.BUILDTYPE }}
|
||||
|
||||
- name: CMake
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
cmake . -B build -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10
|
||||
cmake . -B build -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=${{ env.BUILDTYPE }} -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
|
||||
24
.github/workflows/node-release.yml
vendored
24
.github/workflows/node-release.yml
vendored
@@ -8,7 +8,10 @@ on:
|
||||
required: true
|
||||
type: choice
|
||||
options:
|
||||
- prerelease
|
||||
- prerelease
|
||||
- prepatch
|
||||
- preminor
|
||||
- premajor
|
||||
- patch
|
||||
- minor
|
||||
- major
|
||||
@@ -33,11 +36,18 @@ jobs:
|
||||
with:
|
||||
node-version: 18
|
||||
|
||||
- name: Bump Version
|
||||
- name: npm version
|
||||
id: npmversion
|
||||
run: >-
|
||||
echo "::set-output name=NPM_VERSION::$(
|
||||
npm version ${{ github.event.inputs.version }} --preid pre --no-git-tag-version
|
||||
)"
|
||||
|
||||
- name: Push version to git
|
||||
run: |
|
||||
git config user.name github-actions
|
||||
git config user.email github-actions@github.com
|
||||
npm version ${{ github.event.inputs.version }} --preid pre -m "Update node version to (${{ github.event.inputs.version }})"
|
||||
git commit -a -m "Update node version to ${{ steps.npmversion.outputs.NPM_VERSION }} (${{ github.event.inputs.version }})"
|
||||
git push
|
||||
|
||||
publish_binaries:
|
||||
@@ -139,12 +149,12 @@ jobs:
|
||||
- name: CMake
|
||||
if: runner.os == 'MacOS'
|
||||
run: |
|
||||
cmake . -B build -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=${{ env.BUILDTYPE }} -DMBGL_WITH_COVERAGE=ON
|
||||
cmake . -B build -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=${{ env.BUILDTYPE }}
|
||||
|
||||
- name: CMake
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
cmake . -B build -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10
|
||||
cmake . -B build -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=${{ env.BUILDTYPE }} -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
@@ -216,7 +226,7 @@ jobs:
|
||||
node-version: 18
|
||||
|
||||
- name: Publish to NPM (release)
|
||||
if: github.ref == 'refs/heads/main' && github.event.inputs.version != 'prerelease'
|
||||
if: github.ref == 'refs/heads/main' && (github.event.inputs.version == 'patch' || github.event.inputs.version == 'minor' || github.event.inputs.version == 'major')
|
||||
run: |
|
||||
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
|
||||
npm publish --access public
|
||||
@@ -224,7 +234,7 @@ jobs:
|
||||
NPM_TOKEN: ${{ secrets.NPM_ORG_TOKEN }}
|
||||
|
||||
- name: Publish to NPM (prerelease)
|
||||
if: github.ref == 'refs/heads/main' && github.event.inputs.version == 'prerelease'
|
||||
if: github.ref == 'refs/heads/main' && (github.event.inputs.version == 'prerelease' || github.event.inputs.version == 'prepatch' || github.event.inputs.version == 'preminor' || github.event.inputs.version == 'premajor')
|
||||
run: |
|
||||
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
|
||||
npm publish --tag next --access public
|
||||
|
||||
Reference in New Issue
Block a user