Repository navigation
47 lines (47 loc) · 1.65 KB
/
Copy pathrelease.yml
File metadata and controls
47 lines (47 loc) · 1.65 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
name: release
on:
push:
tags:
- 'webbundle-cli-v*.*.*'
jobs:
build:
env:
BIN_NAME: webbundle
PACKAGE_NAME: webbundle-cli
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: macOS-latest
target: x86_64-apple-darwin
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- run: rustup update stable
- run: rustup target add ${{ matrix.target }}
- run: cargo build --package webbundle-cli --all-features --release --target ${{ matrix.target }}
- run: cargo test --package webbundle-cli --all-features --release --target ${{ matrix.target }}
- name: Package
if: matrix.os != 'windows-latest'
run: |
strip target/${{ matrix.target }}/release/${{ env.BIN_NAME }}
cd target/${{ matrix.target }}/release
tar czvf ../../../${{ env.PACKAGE_NAME }}-${{ matrix.target }}.tar.gz ${{ env.BIN_NAME }}
cd -
- name: Package (windows)
if: matrix.os == 'windows-latest'
run: |
strip target/${{ matrix.target }}/release/${{ env.BIN_NAME }}.exe
cd target/${{ matrix.target }}/release
7z a ../../../${{ env.PACKAGE_NAME }}-${{ matrix.target }}.zip ${{ env.BIN_NAME }}.exe
cd -
- name: Release
uses: softprops/action-gh-release@v1
with:
files: '${{ env.PACKAGE_NAME }}-${{ matrix.target }}*'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}