-
Notifications
You must be signed in to change notification settings - Fork 35
48 lines (47 loc) · 1.5 KB
/
publish.yml
File metadata and controls
48 lines (47 loc) · 1.5 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
48
on:
release:
types: [published]
jobs:
release_binary:
runs-on: ${{ matrix.runs_on }}
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
- x86_64-apple-darwin
- x86_64-pc-windows-gnu
include:
- target: x86_64-unknown-linux-gnu
runs_on: ubuntu-latest
artifact: jtd-codegen
- target: x86_64-unknown-linux-musl
runs_on: ubuntu-latest
artifact: jtd-codegen
- target: x86_64-apple-darwin
runs_on: macos-latest
artifact: jtd-codegen
- target: x86_64-pc-windows-gnu
runs_on: ubuntu-latest
artifact: jtd-codegen.exe
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- run: cargo install cross
- run: cross build --package jtd_codegen_cli --release --target=$TARGET
env:
TARGET: ${{ matrix.target }}
- run: zip --junk-paths $TARGET.zip target/$TARGET/release/$ARTIFACT
env:
TARGET: ${{ matrix.target }}
ARTIFACT: ${{ matrix.artifact }}
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ matrix.target }}.zip
asset_name: ${{ matrix.target }}.zip
asset_content_type: application/zip