Goponent Release 1.17.0 - Increasing minor version (in case of regres… #10
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: CD | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
createRelease: | |
name: Create Release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Get Package Version | |
id: package-version | |
uses: martinbeentjes/npm-get-version-action@master | |
with: | |
path: projects/go-lib | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
generate_release_notes: true | |
tag_name: v${{ steps.package-version.outputs.current-version }} | |
target_commitish: main | |
publishPackage: | |
name: Publish New Package | |
runs-on: ubuntu-latest | |
needs: createRelease | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Cache Node Modules | |
id: cache-node-modules | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: ./node_modules | |
key: npm-${{ hashFiles('package-lock.json') }} | |
- name: Read .nvmrc | |
run: echo NVMRC=`cat .nvmrc` >> $GITHUB_ENV | |
- name: Install Node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ env.NVMRC }} | |
- name: Install npm Packages | |
if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
run: npm ci | |
- name: Publish Package | |
run: npm run publish -- --ignore-scripts |