Skip to content

Commit 2fe78a4

Browse files
committed
+ ci: release-oss.yml
1 parent 1ad9707 commit 2fe78a4

2 files changed

Lines changed: 83 additions & 1 deletion

File tree

.github/workflows/release-oss.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Release OSS
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
id-token: write
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
goos: [linux, darwin]
19+
goarch: [amd64, arm64]
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Go
25+
uses: actions/setup-go@v5
26+
with:
27+
go-version-file: go.mod
28+
29+
- name: Build ${{ matrix.goos }}/${{ matrix.goarch }}
30+
env:
31+
CGO_ENABLED: 0
32+
GOOS: ${{ matrix.goos }}
33+
GOARCH: ${{ matrix.goarch }}
34+
run: |
35+
mkdir -p dist
36+
go build -trimpath -ldflags "-s -w" \
37+
-o "dist/thrust-${{ matrix.goos }}-${{ matrix.goarch }}" ./cmd/thrust
38+
chmod +x "dist/thrust-${{ matrix.goos }}-${{ matrix.goarch }}"
39+
40+
- name: Upload artifact
41+
uses: actions/upload-artifact@v4
42+
with:
43+
name: dist-${{ matrix.goos }}-${{ matrix.goarch }}
44+
path: dist/*
45+
if-no-files-found: error
46+
47+
release:
48+
runs-on: ubuntu-latest
49+
needs: build
50+
steps:
51+
- name: Checkout repository
52+
uses: actions/checkout@v4
53+
54+
- name: Download all artifacts
55+
uses: actions/download-artifact@v4
56+
with:
57+
pattern: dist-*
58+
merge-multiple: true
59+
path: dist
60+
61+
- name: Show built artifacts
62+
run: ls -lah dist
63+
64+
- name: Setup Ruby
65+
uses: ruby/setup-ruby@v1
66+
with:
67+
ruby-version: ruby
68+
bundler-cache: true
69+
70+
- name: Build gems
71+
run: |
72+
bundle exec rake clobber
73+
bundle exec rake package
74+
75+
- name: Show built gems
76+
run: ls -lah pkg
77+
78+
- name: Push gems
79+
uses: rubygems/release-gem@v1
80+
with:
81+
multiple-gems: true
82+
gem-directory: pkg
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: release
1+
name: Release PRO
22
on:
33
release:
44
types: [published]

0 commit comments

Comments
 (0)