-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (57 loc) · 1.75 KB
/
release.yml
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
name: Release
on:
push:
tags: [ 'v*' ]
jobs:
create:
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.release.outputs.upload_url }}
steps:
- uses: actions/create-release@v1
id: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
build:
needs: [ create ]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest ]
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
- os: macos-latest
target: x86_64-apple-darwin
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt
target: ${{ matrix.target }}
- name: Build
run: cargo build --release --target ${{ matrix.target }}
- name: Package
id: package
run: |
ARCHIVE_DIR=fb-unarchive-$(basename $GITHUB_REF)
ARCHIVE=$ARCHIVE_DIR-${{ matrix.target }}.tar.gz
echo "::set-output name=archive::${ARCHIVE}"
mkdir $ARCHIVE_DIR
cp target/${{ matrix.target }}/release/fb-unarchive $ARCHIVE_DIR
tar --auto-compress --create --file $ARCHIVE $ARCHIVE_DIR
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create.outputs.upload_url }}
asset_path: ${{ steps.package.outputs.archive}}
asset_name: ${{ steps.package.outputs.archive}}
asset_content_type: application/tar+gzip