-
Notifications
You must be signed in to change notification settings - Fork 209
61 lines (56 loc) · 1.82 KB
/
Copy pathrelease.yml
File metadata and controls
61 lines (56 loc) · 1.82 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
49
50
51
52
53
54
55
56
57
58
59
60
61
name: release
# Build cross-platform binaries and attach them to a GitHub Release.
# Trigger by pushing a version tag (e.g. `git tag v0.1.0 && git push origin v0.1.0`),
# or run manually from the Actions tab with a tag input.
on:
push:
tags: ["v*"]
workflow_dispatch:
inputs:
tag:
description: "Existing tag to build and release (e.g. v0.1.0)"
required: true
permissions:
contents: write
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.tag || github.ref_name }}
- uses: taiki-e/create-gh-release-action@v1
with:
ref: refs/tags/${{ inputs.tag || github.ref_name }}
token: ${{ secrets.GITHUB_TOKEN }}
upload-assets:
name: ${{ matrix.target }}
needs: create-release
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: aarch64-apple-darwin
os: macos-latest
- target: x86_64-apple-darwin
os: macos-latest # Apple-Silicon runner cross-compiles x86_64 (Intel macos-13 runners are scarce)
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.tag || github.ref_name }}
- name: Build and upload release binary
uses: taiki-e/upload-rust-binary-action@v1
with:
bin: browser-control
target: ${{ matrix.target }}
# Produces e.g. browser-control-aarch64-apple-darwin.tar.gz
archive: browser-control-$target
tar: unix
checksum: sha256
ref: refs/tags/${{ inputs.tag || github.ref_name }}
token: ${{ secrets.GITHUB_TOKEN }}