-
Notifications
You must be signed in to change notification settings - Fork 4
143 lines (135 loc) · 4.06 KB
/
build.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: Build and Release
on:
workflow_call:
push:
branches: [main]
pull_request:
release:
types: [published]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
complete:
if: always()
needs: [cargo, go]
runs-on: ubuntu-latest
steps:
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: exit 1
cargo:
strategy:
fail-fast: false
matrix:
crate:
- name: cargo-workspaces
version: '0.2.35'
- name: cargo-workspaces
version: '0.3.6'
- name: cargo-hack
version: '0.5.28'
- name: cargo-set-rust-version
version: '0.5.0'
- name: cargo-edit
version: '0.11.6'
- name: cargo-fuzz
version: '0.12.0'
- name: cargo-deny
version: '0.14.19'
rust: '1.79.0'
- name: cargo-deny
version: '0.16.1'
- name: cargo-readme
version: '3.3.1'
- name: cargo-semver-checks
version: '0.37.0'
- name: cargo-public-api
version: '0.33.1'
- name: wasm-pack
version: '0.13.0'
- name: wasm-bindgen-cli
version: '0.2.92'
- name: check-lockfile-intersection
version: '0.1.0'
- name: wasm-cs
version: '1.0.0'
runs-on:
- ubuntu-latest
- macos-12 # amd64
- macos-14 # arm64
- windows-latest
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v3
- if: 'matrix.crate.rust'
shell: bash
run: |
rustup install ${{ matrix.crate.rust }}
rustup default ${{ matrix.crate.rust }}
- if: '!matrix.crate.rust'
shell: bash
run: rustup update
- shell: bash
run: |
rustc -V
cargo -V
- uses: stellar/actions/rust-cache@main
- shell: bash
run: cargo install --target-dir ~/.cargo/target --root . --locked --version ${{ matrix.crate.version }} ${{ matrix.crate.name }}
- shell: bash
run: tar cvfz ${{ matrix.crate.name }}-${{ matrix.crate.version }}-${{ runner.os }}-${{ runner.arch }}.tar.gz -C bin .
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.crate.name }}-${{ matrix.crate.version }}-${{ matrix.runs-on }}
path: '*.tar.gz'
go:
strategy:
fail-fast: false
matrix:
package:
- name: actionlint
import-path: github.com/rhysd/actionlint/cmd/actionlint
version: '1.7.1'
runs-on:
- ubuntu-latest
- macos-12 # amd64
- macos-14 # arm64
- windows-latest
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v5
with:
go-version: stable
- shell: bash
run: GOBIN="$PWD/bin" go install ${{ matrix.package.import-path }}@v${{ matrix.package.version }}
- shell: bash
run: tar cvfz ${{ matrix.package.name }}-${{ matrix.package.version }}-${{ runner.os }}-${{ runner.arch }}.tar.gz -C bin .
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.package.name }}-${{ matrix.package.version }}-${{ matrix.runs-on }}
path: '*.tar.gz'
release-create:
if: github.ref_name == 'main'
needs: complete
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- id: set-tag
run: echo "tag=v$(git rev-list --count HEAD)" >> $GITHUB_OUTPUT
- run: gh release -R ${{ github.repository }} create --generate-notes --target ${{ github.sha }} "${{ steps.set-tag.outputs.tag }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
outputs:
tag: ${{ steps.set-tag.outputs.tag }}
release-upload:
if: github.ref_name == 'main'
needs: release-create
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
- run: gh release -R ${{ github.repository }} upload --clobber "${{ needs.release-create.outputs.tag }}" **/*.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}