-
Notifications
You must be signed in to change notification settings - Fork 6
88 lines (81 loc) · 2.37 KB
/
publish-release.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
name: Publish Release
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
cache: 'yarn'
- run: yarnpkg --pure-lockfile
- run: yarnpkg build
- run: yarnpkg lint
- run: yarnpkg test
publish-binaries:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, darwin, windows]
goarch: [amd64]
include:
- goos: darwin
goarch: arm64
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
cache: 'yarn'
- run: yarnpkg --pure-lockfile
- run: yarnpkg build
- uses: wangyoucao577/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
project_path: "./cmd/dsadmin"
binary_name: "dsadmin"
publish-container:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
cache: 'yarn'
- uses: actions/setup-go@v2
with:
go-version: '^1.16'
# - uses: google/ko@main -> This should replace the 2 lines below, but doesn't seem to work
- run: |
curl -L https://github.com/google/ko/releases/download/v0.8.3/ko_0.8.3_Linux_x86_64.tar.gz | sudo tar xzf - ko
chmod +x ./ko
working-directory:
/usr/local/bin
- run: ko login ghcr.io -u ${{ github.repository_owner }} -p ${{ secrets.GITHUB_TOKEN }}
- name: Set release version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- run: yarnpkg --pure-lockfile
- run: yarnpkg build
- run: ko publish -B --tags latest --tags ${{ env.RELEASE_VERSION }} ./cmd/dsadmin
env:
KO_DOCKER_REPO: ghcr.io/remko
publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
cache: 'yarn'
- run: yarnpkg --pure-lockfile
- run: yarnpkg publish --non-interactive
env:
NPM_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}