Skip to content

Commit 3f6b419

Browse files
committed
build: Automatically create GitHub releases
Signed-off-by: Dmitry Dygalo <[email protected]>
1 parent fda420e commit 3f6b419

File tree

5 files changed

+74
-3
lines changed

5 files changed

+74
-3
lines changed

.github/workflows/c-release.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,19 @@ jobs:
1414

1515
- uses: dtolnay/rust-toolchain@stable
1616

17+
- name: Extract Version
18+
run: echo "version=${GITHUB_REF#refs/tags/c-v}" >> $GITHUB_ENV
19+
1720
- name: Build
1821
run: cargo build --release
1922
working-directory: ./bindings/c
2023

21-
- name: Release
24+
- name: GitHub Release
2225
uses: softprops/action-gh-release@v2
2326
with:
2427
make_latest: false
25-
name: "[C] Release ${{ github.ref }}"
28+
draft: true
29+
name: "[C] Release ${{ env.version }}"
2630
files: |
2731
bindings/c/target/release/libcss_inline.so
2832
bindings/c/css_inline.h

.github/workflows/javascript-release.yml

+10
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,16 @@ jobs:
270270
run: yarn artifacts
271271
working-directory: bindings/javascript
272272

273+
- name: Extract Version
274+
run: echo "version=${GITHUB_REF#refs/tags/javascript-v}" >> $GITHUB_ENV
275+
276+
- name: GitHub Release
277+
uses: softprops/action-gh-release@v2
278+
with:
279+
make_latest: false
280+
draft: true
281+
name: "[JavaScript] Release ${{ env.version }}"
282+
273283
- name: Publish to npm packages
274284
run: |
275285
echo "//registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN" >> ~/.npmrc

.github/workflows/python-release.yml

+38-1
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,31 @@ jobs:
277277
name: wheel-pypy-${{ matrix.os }}-${{ matrix.target }}-${{ matrix.python-version }}
278278
path: dist
279279

280+
pyodide:
281+
runs-on: ubuntu-22.04
282+
steps:
283+
- uses: actions/checkout@v4
284+
- uses: dtolnay/rust-toolchain@nightly
285+
with:
286+
toolchain: nightly
287+
targets: wasm32-unknown-emscripten
288+
- uses: actions/setup-python@v5
289+
with:
290+
python-version: 3.12
291+
- run: |
292+
pip install pyodide-build>=0.28.0
293+
echo EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) >> $GITHUB_ENV
294+
- uses: mymindstorm/setup-emsdk@v14
295+
with:
296+
version: ${{ env.EMSCRIPTEN_VERSION }}
297+
- run: pyodide build
298+
working-directory: ./bindings/python
299+
- name: Upload wheels
300+
uses: actions/upload-artifact@v4
301+
with:
302+
name: wheel-pyodide
303+
path: dist
304+
280305
release:
281306
name: Release
282307
runs-on: ubuntu-22.04
@@ -290,6 +315,7 @@ jobs:
290315
- musllinux
291316
- musllinux-cross
292317
- pypy
318+
- pyodide
293319
if: "startsWith(github.ref, 'refs/tags/')"
294320
steps:
295321
- uses: actions/download-artifact@v4
@@ -300,7 +326,18 @@ jobs:
300326
mkdir dist
301327
mv all/*/* dist
302328
- uses: actions/setup-python@v5
303-
- name: Publish to PyPi
329+
- name: Extract Version
330+
run: echo "version=${GITHUB_REF#refs/tags/python-v}" >> $GITHUB_ENV
331+
332+
- name: GitHub Release
333+
uses: softprops/action-gh-release@v2
334+
with:
335+
make_latest: false
336+
draft: true
337+
name: "[Python] Release ${{ env.version }}"
338+
files: dist/**
339+
340+
- name: Publish to PyPI
304341
env:
305342
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
306343
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}

.github/workflows/ruby-release.yml

+10
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ jobs:
1919
bundler-cache: true
2020
working-directory: ./bindings/ruby
2121

22+
- name: Extract Version
23+
run: echo "version=${GITHUB_REF#refs/tags/ruby-v}" >> $GITHUB_ENV
24+
25+
- name: GitHub Release
26+
uses: softprops/action-gh-release@v2
27+
with:
28+
make_latest: false
29+
draft: true
30+
name: "[Ruby] Release ${{ env.version }}"
31+
2232
- name: Publish to RubyGems
2333
run: |
2434
mkdir -p $HOME/.gem

.github/workflows/rust-release.yml

+10
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ jobs:
1313

1414
- uses: dtolnay/rust-toolchain@stable
1515

16+
- name: Extract Version
17+
run: echo "version=${GITHUB_REF#refs/tags/rust-v}" >> $GITHUB_ENV
18+
19+
- name: GitHub Release
20+
uses: softprops/action-gh-release@v2
21+
with:
22+
make_latest: true
23+
draft: true
24+
name: "[Rust] Release ${{ env.version }}"
25+
1626
- run: cargo login ${CRATES_IO_TOKEN}
1727
env:
1828
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}

0 commit comments

Comments
 (0)