Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Automatically create GitHub releases #415

Merged
merged 1 commit into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/c-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,19 @@ jobs:

- uses: dtolnay/rust-toolchain@stable

- name: Extract Version
run: echo "version=${GITHUB_REF#refs/tags/c-v}" >> $GITHUB_ENV

- name: Build
run: cargo build --release
working-directory: ./bindings/c

- name: Release
- name: GitHub Release
uses: softprops/action-gh-release@v2
with:
make_latest: false
name: "[C] Release ${{ github.ref }}"
draft: true
name: "[C] Release ${{ env.version }}"
files: |
bindings/c/target/release/libcss_inline.so
bindings/c/css_inline.h
10 changes: 10 additions & 0 deletions .github/workflows/javascript-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,16 @@ jobs:
run: yarn artifacts
working-directory: bindings/javascript

- name: Extract Version
run: echo "version=${GITHUB_REF#refs/tags/javascript-v}" >> $GITHUB_ENV

- name: GitHub Release
uses: softprops/action-gh-release@v2
with:
make_latest: false
draft: true
name: "[JavaScript] Release ${{ env.version }}"

- name: Publish to npm packages
run: |
echo "//registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN" >> ~/.npmrc
Expand Down
39 changes: 38 additions & 1 deletion .github/workflows/python-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,31 @@ jobs:
name: wheel-pypy-${{ matrix.os }}-${{ matrix.target }}-${{ matrix.python-version }}
path: dist

pyodide:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly
targets: wasm32-unknown-emscripten
- uses: actions/setup-python@v5
with:
python-version: 3.12
- run: |
pip install pyodide-build>=0.28.0
echo EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) >> $GITHUB_ENV
- uses: mymindstorm/setup-emsdk@v14
with:
version: ${{ env.EMSCRIPTEN_VERSION }}
- run: pyodide build
working-directory: ./bindings/python
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheel-pyodide
path: dist

release:
name: Release
runs-on: ubuntu-22.04
Expand All @@ -290,6 +315,7 @@ jobs:
- musllinux
- musllinux-cross
- pypy
- pyodide
if: "startsWith(github.ref, 'refs/tags/')"
steps:
- uses: actions/download-artifact@v4
Expand All @@ -300,7 +326,18 @@ jobs:
mkdir dist
mv all/*/* dist
- uses: actions/setup-python@v5
- name: Publish to PyPi
- name: Extract Version
run: echo "version=${GITHUB_REF#refs/tags/python-v}" >> $GITHUB_ENV

- name: GitHub Release
uses: softprops/action-gh-release@v2
with:
make_latest: false
draft: true
name: "[Python] Release ${{ env.version }}"
files: dist/**

- name: Publish to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/ruby-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ jobs:
bundler-cache: true
working-directory: ./bindings/ruby

- name: Extract Version
run: echo "version=${GITHUB_REF#refs/tags/ruby-v}" >> $GITHUB_ENV

- name: GitHub Release
uses: softprops/action-gh-release@v2
with:
make_latest: false
draft: true
name: "[Ruby] Release ${{ env.version }}"

- name: Publish to RubyGems
run: |
mkdir -p $HOME/.gem
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/rust-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ jobs:

- uses: dtolnay/rust-toolchain@stable

- name: Extract Version
run: echo "version=${GITHUB_REF#refs/tags/rust-v}" >> $GITHUB_ENV

- name: GitHub Release
uses: softprops/action-gh-release@v2
with:
make_latest: true
draft: true
name: "[Rust] Release ${{ env.version }}"

- run: cargo login ${CRATES_IO_TOKEN}
env:
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
Expand Down
Loading