forked from callum-oakley/json5-to-json
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (52 loc) · 1.79 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
name: Release
on:
pull_request:
paths:
- .github/workflows/release.yml
- justfile
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
publish:
timeout-minutes: 10
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v36-rust-musl
steps:
- id: meta
shell: bash
run: |
set -eu
shopt -s extglob
ref="${{ github.ref }}"
if [[ "$ref" == refs/tags/v+([0-9]).+([0-9]).+([0-9])?(-+([a-z0-9-])) ]]; then
v=${ref##refs/tags/}
echo version="$v" >> "$GITHUB_OUTPUT"
else
echo "Not a release version" >&2
fi
# XXX dev:v36-rust container doesn't include libjq
- run: apt update && apt install -y --no-install-recommends jq
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
- run: just fetch
- if: steps.meta.outputs.version
run: |
v=$(just crate-version)
if [ "${v}" != '${{ steps.meta.outputs.version }}' ]; then
echo "::error ::Crate version '${v}' does not match tag version '${{ steps.meta.outputs.version }}'"
exit 1
fi
- run: echo PKG_DIR="$(mktemp -d "$RUNNER_TEMP/pkg.XXX")" >> "$GITHUB_ENV"
- run: just profile=release target=x86_64-unknown-linux-musl package "$PKG_DIR"
- run: just profile=release target=aarch64-unknown-linux-musl package "$PKG_DIR"
- run: find "$PKG_DIR"/release -ls
- if: steps.meta.outputs.version
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: ${{ steps.meta.outputs.version }}
files: ${{ env.PKG_DIR }}/release/*
generate_release_notes: true