Skip to content

Commit 9686319

Browse files
committed
Add release workflow
1 parent a69e8a7 commit 9686319

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/release.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Builds binaries and uploads them to a GitHub release when a v* tag is pushed.
2+
name: Publish release
3+
4+
on:
5+
push:
6+
tags:
7+
- 'v*'
8+
9+
jobs:
10+
create-release:
11+
name: Create release
12+
runs-on: ubuntu-latest
13+
outputs:
14+
upload_url: ${{ steps.create-release.outputs.upload_url }}
15+
steps:
16+
- name: Create release
17+
id: create-release
18+
uses: softprops/action-gh-release@v1
19+
build:
20+
name: Build release binaries
21+
runs-on: ${{ matrix.runner-os }}
22+
needs: create-release
23+
strategy:
24+
matrix:
25+
include:
26+
- runner-os: ubuntu-20.04
27+
rustc-target: "x86_64-unknown-linux-gnu"
28+
steps:
29+
- name: Checkout repo
30+
uses: actions/checkout@v2
31+
- name: Set up Rust toolchain
32+
uses: actions-rs/toolchain@v1
33+
with:
34+
toolchain: stable
35+
target: ${{ matrix.rustc-target }}
36+
override: true
37+
profile: minimal
38+
- name: Build
39+
uses: actions-rs/cargo@v1
40+
with:
41+
command: build
42+
args: "--release"
43+
- name: Create tarball
44+
run: |
45+
mkdir out
46+
cp target/release/oci-interceptor out/
47+
cp README.md LICENSE.md CHANGELOG.md out/
48+
cd out && tar czf oci-interceptor_${rustc-target}.tar.gz *
49+
env:
50+
rustc-target: ${{ matrix.rustc-target }}
51+
- name: Upload tarball
52+
uses: softprops/action-gh-release@v1
53+
with:
54+
files: out/*.tar.gz

0 commit comments

Comments
 (0)