forked from railwayapp/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (68 loc) · 2.14 KB
/
Copy pathpublish.yml
File metadata and controls
83 lines (68 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Publish
on:
push:
tags:
- "*"
jobs:
release_and_brew:
name: Release and bump Brew
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
id: go
with:
go-version: ^1.13
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
publish_npm:
name: Publish to NPM
needs: release_and_brew
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set version
id: vars
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: Check version
run: echo "Version ${{ steps.vars.outputs.tag }}"
- name: Use Node.js 12
uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- name: Setup Git user
run: |
git config --global user.name "Github Bot"
git config --global user.email "github-bot@railway.app"
- name: Create .npmrc file
run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Bump NPM version
run: npm --no-git-tag-version --allow-same-version version ${{ steps.vars.outputs.tag }}
- name: NPM publish
run: npm publish --access public
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Discord Deployment Status Notification
uses: sarisia/actions-status-discord@v1
with:
webhook: ${{ secrets.DEPLOY_WEBHOOK }}
status: ${{ job.status }}
title: "Published CLI"
description: "Published CLI version ${{ steps.vars.outputs.tag }} to Brew and NPM"
nofail: false
nodetail: false
username: Github Actions
avatar_url: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png