-
-
Notifications
You must be signed in to change notification settings - Fork 11
88 lines (80 loc) · 2.66 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
name: Release workflow
on:
release:
types: [published]
pull_request:
branches:
- main
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: true
jobs:
build-release:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
include:
- operating-system: ubuntu-20.04
targets: x86_64-unknown-linux-gnu,x86_64-unknown-linux-musl,aarch64-unknown-linux-gnu,aarch64-unknown-linux-musl
- operating-system: windows-2019
targets: aarch64-pc-windows-msvc,x86_64-pc-windows-msvc
- operating-system: macos-12
targets: aarch64-apple-darwin,x86_64-apple-darwin
fail-fast: false
env:
pact_do_not_track: true
steps:
- uses: actions/checkout@v4
- name: Install stable Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: ${{ matrix.targets }}
- name: Rust caching
uses: Swatinem/rust-cache@v2
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
if: runner.os == 'Linux'
uses: docker/setup-buildx-action@v3
- name: Install LLVM
run: choco install -y llvm
if: runner.os == 'Windows'
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Cargo flags
id: cargo-flags
shell: bash
run: |
if [[ "${{ github.event_name }}" = "release" ]]; then
echo "flags=--release" >> "$GITHUB_OUTPUT"
else
echo "flags=" >> "$GITHUB_OUTPUT"
fi
- if: |
github.event_name == 'push' ||
github.event_name == 'pull_request' ||
startsWith(github.ref, 'refs/tags/csv-plugin')
run: ./release.sh ${{ runner.os }} ${{ steps.cargo-flags.outputs.flags }}
shell: bash
working-directory: plugins/csv
- if: |
github.event_name == 'push' ||
github.event_name == 'pull_request' ||
startsWith(github.ref, 'refs/tags/pact-plugin-cli')
run: ./release.sh ${{ runner.os }} ${{ steps.cargo-flags.outputs.flags }}
shell: bash
working-directory: cli
- name: Upload Release Assets
if: |
startsWith(github.ref, 'refs/tags/pact-plugin-cli') ||
startsWith(github.ref, 'refs/tags/csv-plugin')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: release_artifacts/*
file_glob: true
tag: ${{ github.ref }}