-
-
Notifications
You must be signed in to change notification settings - Fork 7
102 lines (102 loc) · 3.71 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
name: Release
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
workflow_dispatch:
inputs:
tag:
description: The tag to manually run a deploy for.
required: true
jobs:
org-check:
name: Check GitHub Organization
if: ${{ github.repository_owner == 'a-scie' }}
runs-on: ubuntu-22.04
steps:
- name: Noop
run: "true"
determine-tag:
name: Determine the release tag to operate against.
needs: org-check
runs-on: ubuntu-22.04
outputs:
release-tag: ${{ steps.determine-tag.outputs.release-tag }}
release-version: ${{ steps.determine-tag.outputs.release-version }}
steps:
- name: Determine Tag
id: determine-tag
run: |
if [[ -n "${{ github.event.inputs.tag }}" ]]; then
RELEASE_TAG=${{ github.event.inputs.tag }}
else
RELEASE_TAG=${GITHUB_REF#refs/tags/}
fi
if [[ "${RELEASE_TAG}" =~ ^v[0-9]+.[0-9]+.[0-9]+$ ]]; then
echo "release-tag=${RELEASE_TAG}" >> $GITHUB_OUTPUT
echo "release-version=${RELEASE_TAG#v}" >> $GITHUB_OUTPUT
else
echo "::error::Release tag '${RELEASE_TAG}' must match 'v\d+.\d+.\d+'."
exit 1
fi
github-release:
name: (${{ matrix.os }}) Create Github Release
needs: determine-tag
runs-on: ${{ matrix.os }}
strategy:
matrix:
# N.B.: macos-12 is the oldest non-deprecated Intel Mac runner and macos-14 is the oldest
# non-deprecated ARM Mac runner.
os: [ ubuntu-22.04, macos-12, macos-14, windows-2022 ]
environment: Release
steps:
- name: Checkout scie-jump ${{ needs.determine-tag.outputs.release-tag }}
uses: actions/checkout@v4
with:
ref: ${{ needs.determine-tag.outputs.release-tag }}
- name: Package scie-jump ${{ needs.determine-tag.outputs.release-tag }} binary
if: ${{ matrix.os != 'ubuntu-22.04' }}
run: cargo run -p package -- dist
- name: Package scie-jump ${{ needs.determine-tag.outputs.release-tag }} binary
if: ${{ matrix.os == 'ubuntu-22.04' }}
run: |
mkdir dist
docker run --rm \
-v $PWD:/code \
-w /code \
rust:1.78.0-alpine3.19 \
sh -c 'apk add musl-dev && cargo run -p package -- dist'
- name: Prepare Changelog
id: prepare-changelog
uses: a-scie/actions/[email protected]
with:
changelog-file: ${{ github.workspace }}/CHANGES.md
version: ${{ needs.determine-tag.outputs.release-version }}
setup-python: ${{ matrix.os != 'macos-13-aarch64' }}
- name: Create ${{ needs.determine-tag.outputs.release-tag }} Release
# Upgrades node16 -> node20: in main but not tagged yet.
uses: softprops/action-gh-release@4634c16e79c963813287e889244c50009e7f0981
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.determine-tag.outputs.release-tag }}
name: scie-jump ${{ needs.determine-tag.outputs.release-version }}
body_path: ${{ steps.prepare-changelog.outputs.changelog-file }}
draft: false
prerelease: false
files: dist/scie-jump*
fail_on_unmatched_files: true
discussion_category_name: Announcements
aarch64-release-trigger:
name: Trigger Circle CI Linux aarch64 Github Release
needs:
- determine-tag
- github-release
runs-on: ubuntu-22.04
steps:
- name: Trigger aarch64 release
uses: CircleCI-Public/[email protected]
with:
GHA_Meta: "${{ needs.determine-tag.outputs.release-tag }}"
env:
CCI_TOKEN: ${{ secrets.CCI_TOKEN }}