-
Notifications
You must be signed in to change notification settings - Fork 1
120 lines (120 loc) · 3.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: Release
on:
push:
branches: [main]
tags-ignore: [dev]
defaults:
run:
shell: bash
# Cancel any in-flight jobs for the same PR/branch so there's only one active
# at a time
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-cli:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
working-directory: cli
strategy:
matrix:
include:
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: aarch64-apple-darwin
os: macos-latest
- target: aarch64-pc-windows-msvc
os: windows-latest
- target: aarch64-unknown-linux-musl
os: ubuntu-latest
- target: arm-unknown-linux-gnueabi
os: ubuntu-latest
- target: arm-unknown-linux-gnueabihf
os: ubuntu-latest
- target: armv7-unknown-linux-gnueabihf
os: ubuntu-latest
- target: s390x-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
target: ${{ matrix.target }}
# So that windows uses StrawberryPerl which uses windows path separators
- run: rm -f /usr/bin/perl
if: matrix.os == 'windows-latest'
- uses: Swatinem/rust-cache@v2
with:
workspaces: "cli"
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --manifest-path cli/Cargo.toml --release --locked --verbose --target=${{ matrix.target }}
use-cross: true
- run: ../ci/build-tarballs.sh "${{ matrix.target }}" "${{ matrix.target }}"
- uses: actions/upload-artifact@v1
with:
name: bins-${{ matrix.target }}
path: cli/dist
publish-cli:
needs: [build-cli]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v3
with:
path: cli/dist
- name: Publish Release
uses: softprops/action-gh-release@v1
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
with:
name: ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
prerelease: ${{ github.ref_name == 'main' && true || false }}
files: "cli/dist/**/*"
# publish-javascript-library:
# runs-on: ubuntu-latest
# permissions:
# contents: read
# packages: write
# defaults:
# run:
# shell: bash
# working-directory: libraries/javascript
# steps:
# - uses: actions/checkout@v2
# - name: Calculate tag name
# run: |
# name=dev
# if [[ $GITHUB_REF == refs/tags/v* ]]; then
# name=${GITHUB_REF:10}
# fi
# echo ::set-output name=val::$name
# echo TAG=$name >> $GITHUB_ENV
# id: tagname
# - uses: actions/setup-node@v3
# with:
# node-version: '16.x'
# registry-url: 'https://npm.pkg.github.com'
# # Defaults to the user or organization that owns the workflow file
# scope: '@jakechampion'
# - run: npm ci
# - run: npm version "0.0.0-$GITHUB_SHA"
# - run: npm publish --tag dev --registry 'https://npm.pkg.github.com'
# env:
# NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}