-
Notifications
You must be signed in to change notification settings - Fork 173
90 lines (79 loc) · 2.44 KB
/
publish.yml
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
84
85
86
87
88
89
90
name: "🚀 🟢 Npm Publish Package"
on:
push:
branches: [main]
jobs:
release:
name: 🚀 Npm Publish
runs-on: ubuntu-latest
if: "startsWith(github.event.head_commit.message, 'Release:')"
strategy:
matrix:
node-version: [15.x]
go-version: [1.16]
steps:
- uses: actions/checkout@v2
- name: 🟢 Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
registry-url: "https://registry.npmjs.org"
token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Export Go
run: go env -w GO111MODULE=auto
working-directory: ./
- name: Install golang dependencies
run: while read l; do go get -v "$l"; done < <(go list -f '{{ join .Imports "\n" }}' ./cycletls)
shell: bash
- name: Install deps
run: npm ci --unsafe-perm
working-directory: ./
- name: List changes
run: git status --verbose
working-directory: ./
- name: set name
run: git config --global user.name 'Danny-Dasilva'
- name: set email
run: git config --global user.email 'secrets.EMAIL'
- name: bump version
run: npm version patch -m "Release"
- name: Retrieve Latest Version
run: |
echo "::set-output name=LATEST_VERSION::$(npm view ${{ env.PACKAGE_NAME }} version)"
id: version
- name: Tag git
run: git tag ${{ steps.version.outputs.LATEST_VERSION }}
- name: Tag git
run: git push origin ${{ steps.version.outputs.LATEST_VERSION }}
- name: Push git
run: git push
- name: 🚀 Publish
run: npm publish
working-directory: ./
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v3
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}