-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cd): add push button release via github actions
- Loading branch information
Showing
3 changed files
with
91 additions
and
22 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: Publish | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Version to pass to release.sh [vX.X.X]' | ||
required: true | ||
|
||
jobs: | ||
version: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
# pull all the branches and tags | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 14 | ||
registry-url: https://registry.npmjs.org/ | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.16 | ||
|
||
- name: Install git-chglog | ||
run: | | ||
curl https://i.jpillora.com/git-chglog/git-chglog! | sudo bash | ||
- name: Cache node modules | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
# npm cache files are stored in `~/.npm` on Linux/macOS | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- name: Install Dependencies | ||
run: npm install | ||
|
||
- name: Setup git user | ||
run: | | ||
git config --local user.email "github-actions[bot]@users.noreply.github.com" | ||
git config --local user.name "github-actions[bot]" | ||
- name: npm version | ||
run: | | ||
npm version ${{ github.event.inputs.version }} | ||
- name: Push changes | ||
uses: ad-m/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
tags: true | ||
branch: ${{ github.ref }} | ||
|
||
- name: Create Release | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: npm publish | ||
run: npm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.ORG_NPM_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.ORG_NPM_TOKEN }} | ||
token: ${{ secrets.ORG_NPM_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# This is an example .goreleaser.yml file with some sane defaults. | ||
# Make sure to check the documentation at http://goreleaser.com | ||
project_name: "@goodwaygroup/lib-hapi-rollbar" | ||
|
||
builds: | ||
- skip: true | ||
|
||
changelog: | ||
sort: desc | ||
filters: | ||
exclude: | ||
- '^Merge' |