-
Notifications
You must be signed in to change notification settings - Fork 1
104 lines (99 loc) · 2.79 KB
/
release-workflow.yml
File metadata and controls
104 lines (99 loc) · 2.79 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Release Workflow for Platformer CLI
on:
push:
tags:
- "v*.*.*"
jobs:
test:
name: Run tests and linters
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "14"
- run: yarn
- run: yarn test
npm-pkg-release:
name: NPM Package
needs: [test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "14"
- run: yarn
- name: Set release version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
win-deb-build:
name: Build Windows and Linux binaries
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "14"
- run: yarn
- run: sudo npm install -g @oclif/dev-cli
- run: sudo apt install nsis p7zip-full
- run: sudo oclif-dev pack:deb
- run: sudo oclif-dev pack:win
- uses: actions/upload-artifact@v2
name: Upload Windows and Debian binaries as artifacts
with:
name: win-deb-binaries
path: ${{ github.workspace }}/dist/**/*
retention-days: 1
if-no-files-found: error
macos-build:
name: Build MacOS binary
runs-on: macos-latest
needs: [test]
steps:
- uses: actions/checkout@v2
- run: yarn
- run: npm i -g @oclif/dev-cli
- run: oclif-dev pack:macos
- uses: actions/upload-artifact@v2
name: Upload MacOS binaries as artifacts
with:
name: macos-binaries
path: ${{ github.workspace }}/dist/**/*
retention-days: 1
if-no-files-found: error
release:
name: Github Release
needs:
- win-deb-build
- macos-build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set release version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- uses: actions/download-artifact@v2
name: Download Windows and Debian builds
with:
name: win-deb-binaries
path: artifacts
- uses: actions/download-artifact@v2
name: Download MacOS builds
with:
name: macos-binaries
path: artifacts
- name: Create release and upload assets
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
name: Release ${{ env.RELEASE_VERSION }}
prerelease: false
draft: true
files: |
artifacts/**/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}