Skip to content

Commit 15726e6

Browse files
chore(ci): extract python and ruby release jobs into a separate workflow file (#246)
1 parent bb1aeb1 commit 15726e6

File tree

3 files changed

+290
-270
lines changed

3 files changed

+290
-270
lines changed
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
name: Python Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'python-*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
python-release-linux:
13+
needs: [ 'python-release' ]
14+
name: Release python linux amd64
15+
runs-on: ubuntu-x64-large
16+
steps:
17+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
18+
with:
19+
persist-credentials: false
20+
- run: make wheel/linux/amd64
21+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
22+
with:
23+
name: ${{ github.sha }}-python-amd64
24+
path: pyroscope_ffi/python/dist/*
25+
26+
- name: Upload release artifact
27+
uses: korniltsev/actions-upload-release-asset@a7f1a48a96ff80f206fd26bdbfcf81539d44fa5e # TODO(korniltsev): get rid of this fork
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
with:
31+
upload_url: ${{ needs.python-release.outputs.upload_url }}
32+
asset_path: "pyroscope_ffi/python/dist/pyroscope*.whl"
33+
python-release-linux-arm:
34+
needs: [ 'python-release' ]
35+
name: Release python linux arm64
36+
runs-on: ubuntu-arm64-large
37+
steps:
38+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
39+
with:
40+
persist-credentials: false
41+
- run: make wheel/linux/arm64
42+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
43+
with:
44+
name: ${{ github.sha }}-python-arm64
45+
path: pyroscope_ffi/python/dist/*
46+
47+
- name: Upload release artifact
48+
uses: korniltsev/actions-upload-release-asset@a7f1a48a96ff80f206fd26bdbfcf81539d44fa5e # TODO(korniltsev): get rid of this fork
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
with:
52+
upload_url: ${{ needs.python-release.outputs.upload_url }}
53+
asset_path: "pyroscope_ffi/python/dist/pyroscope*.whl"
54+
python-release-macos:
55+
needs: [ 'python-release' ]
56+
strategy:
57+
fail-fast: false
58+
matrix:
59+
include:
60+
- macos-version: "14"
61+
target: x86_64-apple-darwin
62+
mk-arch: amd64
63+
- macos-version: "14"
64+
target: aarch64-apple-darwin
65+
mk-arch: arm64
66+
67+
name: macOS - ${{ matrix.target }}
68+
runs-on: macos-${{ matrix.macos-version }}
69+
70+
steps:
71+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
72+
with:
73+
persist-credentials: false
74+
75+
- uses: dtolnay/rust-toolchain@888c2e1ea69ab0d4330cbf0af1ecc7b68f368cc1
76+
with:
77+
toolchain: 1.85.0
78+
target: ${{ matrix.target }}
79+
80+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # 5.6.0
81+
with:
82+
python-version: 3.11
83+
84+
- run: make pyroscope_ffi/clean wheel/mac/${{ matrix.mk-arch }}
85+
86+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
87+
with:
88+
name: ${{ github.sha }}-python-macos-${{ matrix.target }}
89+
path: pyroscope_ffi/python/dist/*
90+
91+
- name: Upload release artifact
92+
uses: korniltsev/actions-upload-release-asset@a7f1a48a96ff80f206fd26bdbfcf81539d44fa5e # TODO(korniltsev): get rid of this fork
93+
env:
94+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
95+
with:
96+
upload_url: ${{ needs.python-release.outputs.upload_url }}
97+
asset_path: "pyroscope_ffi/python/dist/pyroscope*.whl"
98+
python-release-sdist:
99+
needs: [ 'python-release' ]
100+
name: sdist
101+
runs-on: ubuntu-x64-small
102+
103+
steps:
104+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
105+
with:
106+
persist-credentials: false
107+
108+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # 5.6.0
109+
with:
110+
python-version: 3.9
111+
- name: Upgrade pip
112+
run: |
113+
python -m pip install --upgrade pip pipenv wheel
114+
- name: Build sdist
115+
run: python setup.py sdist
116+
working-directory: pyroscope_ffi/python
117+
118+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
119+
with:
120+
name: ${{ github.sha }}-python-sdist
121+
path: pyroscope_ffi/python/dist/*
122+
123+
- name: Upload release artifact
124+
uses: korniltsev/actions-upload-release-asset@a7f1a48a96ff80f206fd26bdbfcf81539d44fa5e # TODO(korniltsev): get rid of this fork
125+
env:
126+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
127+
with:
128+
upload_url: ${{ needs.python-release.outputs.upload_url }}
129+
asset_path: "pyroscope_ffi/python/dist/pyroscope-io-*.tar.gz"
130+
python-release:
131+
name: Python Package
132+
runs-on: ubuntu-x64-small
133+
outputs:
134+
upload_url: ${{ steps.auto-release.outputs.upload_url }}
135+
steps:
136+
- id: auto-release
137+
uses: "marvinpinto/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0" # v1.2.1 TODO(korniltsev): get rid of this, this one is unmaintained
138+
with:
139+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
140+
automatic_release_tag: "${{ github.ref_name }}"
141+
title: "Python Package: ${{ github.ref_name }}"
142+
draft: true
143+
prerelease: false

.github/workflows/release-ruby.yml

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
name: Ruby Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'ruby-*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
ruby-release-linux:
13+
needs: [ 'ruby-release' ]
14+
name: Release Linux gem amd64
15+
runs-on: ubuntu-x64-large
16+
steps:
17+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
18+
with:
19+
persist-credentials: false
20+
- run: make gem/linux/amd64
21+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
22+
with:
23+
name: ${{ github.sha }}-ruby-amd64
24+
path: pyroscope_ffi/ruby/pkg/*.gem
25+
26+
- name: Upload release artifact
27+
uses: korniltsev/actions-upload-release-asset@a7f1a48a96ff80f206fd26bdbfcf81539d44fa5e # TODO(korniltsev): get rid of this fork
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
with:
31+
upload_url: ${{ needs.ruby-release.outputs.upload_url }}
32+
asset_path: "pyroscope_ffi/ruby/pkg/*.gem"
33+
34+
ruby-release-linux-arm:
35+
needs: [ 'ruby-release' ]
36+
name: Release Linux gem arm64
37+
runs-on: ubuntu-arm64-large
38+
steps:
39+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
40+
with:
41+
persist-credentials: false
42+
- run: make gem/linux/arm64
43+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
44+
with:
45+
name: ${{ github.sha }}-ruby-arm64
46+
path: pyroscope_ffi/ruby/pkg/*.gem
47+
48+
- name: Upload release artifact
49+
uses: korniltsev/actions-upload-release-asset@a7f1a48a96ff80f206fd26bdbfcf81539d44fa5e # TODO(korniltsev): get rid of this fork
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
with:
53+
upload_url: ${{ needs.ruby-release.outputs.upload_url }}
54+
asset_path: "pyroscope_ffi/ruby/pkg/*.gem"
55+
56+
ruby-release-macos:
57+
needs: [ 'ruby-release' ]
58+
strategy:
59+
fail-fast: false
60+
matrix:
61+
include:
62+
- macos-version: "14"
63+
target: x86_64-apple-darwin
64+
mk-arch: amd64
65+
- macos-version: "14"
66+
target: aarch64-apple-darwin
67+
mk-arch: arm64
68+
69+
name: macOS - ${{ matrix.target }}
70+
runs-on: macos-${{ matrix.macos-version }}
71+
72+
steps:
73+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
74+
with:
75+
persist-credentials: false
76+
- uses: ruby/setup-ruby@dffc446db9ba5a0c4446edb5bca1c5c473a806c5 # v1.235.0
77+
with:
78+
ruby-version: '3.1'
79+
- uses: dtolnay/rust-toolchain@888c2e1ea69ab0d4330cbf0af1ecc7b68f368cc1
80+
with:
81+
toolchain: 1.85.0
82+
target: ${{ matrix.target }}
83+
84+
- run: make pyroscope_ffi/clean gem/mac/${{ matrix.mk-arch }}
85+
86+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
87+
with:
88+
name: ${{ github.sha }}-ruby-mac-${{ matrix.target }}
89+
path: pyroscope_ffi/ruby/pkg/*.gem
90+
91+
- name: Upload release artifact
92+
uses: korniltsev/actions-upload-release-asset@a7f1a48a96ff80f206fd26bdbfcf81539d44fa5e # TODO(korniltsev): get rid of this fork
93+
env:
94+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
95+
with:
96+
upload_url: ${{ needs.ruby-release.outputs.upload_url }}
97+
asset_path: "pyroscope_ffi/ruby/pkg/*.gem"
98+
99+
ruby-release-source:
100+
needs: [ 'ruby-release' ]
101+
name: source
102+
runs-on: ubuntu-x64-small
103+
104+
steps:
105+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
106+
with:
107+
persist-credentials: false
108+
109+
- uses: ruby/setup-ruby@dffc446db9ba5a0c4446edb5bca1c5c473a806c5 # v1.235.0
110+
with:
111+
ruby-version: '3.1'
112+
113+
- name: Install bundles
114+
run: bundle
115+
working-directory: pyroscope_ffi/ruby
116+
117+
- name: Build source gem
118+
run: rake source:gem
119+
working-directory: pyroscope_ffi/ruby
120+
121+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
122+
with:
123+
name: ${{ github.sha }}-ruby-source
124+
path: pyroscope_ffi/ruby/pkg/*.gem
125+
126+
- name: Upload release artifact
127+
uses: korniltsev/actions-upload-release-asset@a7f1a48a96ff80f206fd26bdbfcf81539d44fa5e # TODO(korniltsev): get rid of this fork
128+
env:
129+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
130+
with:
131+
upload_url: ${{ needs.ruby-release.outputs.upload_url }}
132+
asset_path: "pyroscope_ffi/ruby/pkg/*.gem"
133+
134+
ruby-release:
135+
name: Ruby Gem
136+
runs-on: ubuntu-x64-small
137+
outputs:
138+
upload_url: ${{ steps.auto-release.outputs.upload_url }}
139+
steps:
140+
- id: auto-release
141+
uses: "marvinpinto/action-automatic-releases@919008cf3f741b179569b7a6fb4d8860689ab7f0" # v1.2.1 TODO(korniltsev): get rid of this, this one is unmaintained
142+
with:
143+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
144+
automatic_release_tag: "${{ github.ref_name }}"
145+
title: "Ruby Gem: ${{ github.ref_name }}"
146+
draft: true
147+
prerelease: false

0 commit comments

Comments
 (0)