Skip to content

Commit cf85f05

Browse files
authored
Merge pull request #36 from nautls/release-pipeline
Release pipeline
2 parents 71aa4bb + 14d0553 commit cf85f05

File tree

2 files changed

+54
-3
lines changed

2 files changed

+54
-3
lines changed

.github/workflows/ci.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
lint:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v4
1313
- uses: denoland/setup-deno@v1
1414
with:
1515
deno-version: v1.x
@@ -20,7 +20,7 @@ jobs:
2020
test:
2121
runs-on: ubuntu-latest
2222
steps:
23-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v4
2424
- uses: denoland/setup-deno@v1
2525
with:
2626
deno-version: v1.x
@@ -32,7 +32,7 @@ jobs:
3232
os: [ubuntu-22.04, macos-12, windows-2022]
3333
runs-on: ${{ matrix.os }}
3434
steps:
35-
- uses: actions/checkout@v3
35+
- uses: actions/checkout@v4
3636
- uses: denoland/setup-deno@v1
3737
with:
3838
deno-version: v1.x

.github/workflows/release.yaml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: release
2+
3+
on:
4+
# automatically run on pushes to main with a changed `version.ts` file
5+
push:
6+
branches:
7+
- main
8+
paths:
9+
- src/version.ts
10+
# allow for manual trigger
11+
workflow_dispatch:
12+
13+
jobs:
14+
compile:
15+
strategy:
16+
matrix:
17+
target: [x86_64-unknown-linux-gnu, x86_64-pc-windows-msvc, x86_64-apple-darwin, aarch64-apple-darwin]
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: denoland/setup-deno@v1
22+
with:
23+
deno-version: v1.x
24+
- name: Compile all targets
25+
run: deno compile -A --output bin/ergomatic-${{ matrix.target }} --target ${{ matrix.target }} src/cli.ts
26+
- uses: actions/upload-artifact@v3
27+
with:
28+
name: release-artifacts
29+
path: bin/*
30+
release:
31+
needs: [compile]
32+
runs-on: ubuntu-latest
33+
permissions:
34+
contents: write
35+
steps:
36+
- uses: actions/checkout@v4
37+
- uses: actions/download-artifact@v3
38+
with:
39+
name: release-artifacts
40+
path: bin
41+
- name: Get version
42+
id: version
43+
run: |
44+
echo "::set-output name=version::$(grep -o -P '([0-9]+\.[0-9]+\.[0-9]+)' src/version.ts)"
45+
- uses: ncipollo/release-action@v1
46+
with:
47+
artifacts: bin/*
48+
commit: main
49+
tag: v${{ steps.version.outputs.version }}
50+
body: "Release version ${{ steps.version.outputs.version }}"
51+

0 commit comments

Comments
 (0)