Skip to content

Commit b054755

Browse files
ci: Add GitHub Action for cutting releases. (#41)
1 parent 189afcd commit b054755

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/release.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Release
2+
on:
3+
push:
4+
tags:
5+
- 'scip-ruby-v.*'
6+
7+
jobs:
8+
create-release:
9+
name: 'Create release'
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Create Release Step
13+
id: create_release
14+
run: gh release create "$TAG" --title "scip-ruby release $TAG"
15+
env:
16+
TAG: ${{ github.event.ref }}
17+
18+
build-and-upload-artifacts:
19+
name: 'Build and upload artifacts'
20+
needs: create-release
21+
strategy:
22+
matrix:
23+
platform: [ubuntu-latest, macos-latest]
24+
runs-on: ${{ matrix.platform }}
25+
env:
26+
TAG: ${{ github.event.ref }}
27+
steps:
28+
- uses: actions/checkout@v3
29+
- name: Install Bazel
30+
run: sudo npm install --location=global @bazel/bazelisk
31+
- name: Manually evict cache entry if applicable
32+
run: ACCESS_TOKEN='${{ secrets.GITHUB_TOKEN }}' python3 .github/workflows/evict.py
33+
- name: Identify OS
34+
run: |
35+
case "$(uname -s)" in
36+
Linux*) os="linux";;
37+
Darwin*) os="darwin";;
38+
*) echo "Unhandled OS type" && exit 1;;
39+
esac
40+
echo "os=$os" >> "$GITHUB_ENV"
41+
- name: Run debug build
42+
run: bazel build //main:scip-ruby --config=dbg
43+
- name: Upload debug binary
44+
run: |
45+
debugBinaryPath="scip-ruby-debug-$osname-$(uname -m)"
46+
mv "bazel-out/$os-dbg/bin/main/scip-ruby" "$debugBinaryPath"
47+
gh release upload "$TAG" "$debugBinaryPath"
48+
- name: Run release build
49+
run: bazel build //main:scip-ruby
50+
- name: Upload release binary
51+
run: |
52+
releaseBinaryPath="scip-ruby-$osname-$(uname -m)"
53+
mv "bazel-out/$osname-fastbuild/bin/main/scip-ruby" "$releaseBinaryPath"
54+
gh release upload "$TAG" "$releaseBinaryPath"

0 commit comments

Comments
 (0)