Skip to content

Commit ff861c7

Browse files
committed
Split artifact and release jobs
1 parent 59ccb71 commit ff861c7

File tree

2 files changed

+54
-20
lines changed

2 files changed

+54
-20
lines changed

.github/workflows/artifact.yaml

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ env:
1010
RUSTFLAGS: -Dwarnings
1111

1212
jobs:
13-
build_and_release:
14-
name: Build artifact and release
13+
build_artifact:
14+
name: Build artifact
1515
runs-on: ubuntu-20.04
1616

1717
steps:
@@ -48,21 +48,3 @@ jobs:
4848
with:
4949
name: function.zip
5050
path: ${{ github.workspace }}/build.function/
51-
52-
# - name: Release
53-
# uses: fnkr/github-action-ghr@v1
54-
# if: startsWith(github.ref, 'refs/tags/')
55-
# env:
56-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57-
# GHR_PATH: ${{ github.workspace }}/build.function/
58-
# GHR_COMPRESS: zip
59-
60-
- name: Release artifact
61-
uses: ncipollo/release-action@v1
62-
if: startsWith(github.ref, 'refs/tags/')
63-
with:
64-
token: ${{ secrets.GITHUB_TOKEN }}
65-
artifact: "${{ github.workspace }}/lambda/function.zip"
66-
body: |
67-
Body content of a release
68-
# omitBody: true

.github/workflows/release.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: GitHub Release
2+
3+
on:
4+
push:
5+
tags: [ '*' ]
6+
7+
env:
8+
RUSTFLAGS: -Dwarnings
9+
10+
jobs:
11+
build_and_release:
12+
name: Create GitHub Release
13+
runs-on: ubuntu-20.04
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
18+
- uses: actions-rs/toolchain@v1
19+
with:
20+
toolchain: stable
21+
profile: minimal
22+
override: true
23+
24+
- uses: jetli/[email protected]
25+
with:
26+
version: 'latest'
27+
28+
- uses: actions/setup-node@v2
29+
with:
30+
node-version: '12'
31+
32+
- uses: Swatinem/rust-cache@v1
33+
with:
34+
working-directory: rust
35+
36+
- uses: actions/cache@v2
37+
with:
38+
path: ~/.npm
39+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
40+
restore-keys: |
41+
${{ runner.os }}-node-
42+
43+
- run: make ci.artifact
44+
45+
- name: Release artifact
46+
uses: ncipollo/release-action@v1
47+
if: startsWith(github.ref, 'refs/tags/')
48+
with:
49+
token: ${{ secrets.GITHUB_TOKEN }}
50+
artifact: "${{ github.workspace }}/lambda/function.zip"
51+
body: |
52+
Body content of a release

0 commit comments

Comments
 (0)