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

Add prebuilt mozjs archive CI #454

Merged
merged 29 commits into from
Mar 9, 2024
Merged
Changes from 9 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6aef1eb
Add release CI pipeline
wusyong Feb 29, 2024
ad84256
Rename CI pipeline
wusyong Feb 29, 2024
c5bf7c2
Update CI trigger condition
wusyong Feb 29, 2024
d3e69ac
Merge CI into one file
wusyong Feb 29, 2024
7c1b25a
Add release steps
wusyong Feb 29, 2024
a29f3a0
Merge pull request #13 from wusyong/mozjs_release_patch
wusyong Mar 1, 2024
83793f4
Update widnow target arguments
wusyong Mar 1, 2024
d150367
Simplify release workflow
wusyong Mar 1, 2024
0737a22
Merge pull request #17 from wusyong/mozjs_patch
wusyong Mar 1, 2024
0b3f0b5
Add release check CI
wusyong Mar 2, 2024
9790c30
Update trigger condition and remove deps
wusyong Mar 4, 2024
2e0efed
Add CARGO_TARGET_DIR on Windows job
wusyong Mar 4, 2024
3c94562
Merge pull request #21 from wusyong/gh
wusyong Mar 4, 2024
a8370a3
Merge all jobs in release into one
wusyong Mar 4, 2024
2076043
Merge pull request #24 from wusyong/onejob
wusyong Mar 4, 2024
d84ff44
Check from artifact as well
wusyong Mar 4, 2024
3800976
Extract --features
wusyong Mar 4, 2024
dee33e6
Rename MOZJS_ARCHIVE path
wusyong Mar 4, 2024
72f6675
Merge pull request #27 from wusyong/ar
wusyong Mar 4, 2024
94afc62
Fix missed matrix.features
wusyong Mar 4, 2024
713e84e
Update release jobs
wusyong Mar 5, 2024
495e7e5
Merge pull request #29 from wusyong/rj
wusyong Mar 5, 2024
b154d0a
Update release tag name and check if exist before release
wusyong Mar 6, 2024
3241ac0
Merge pull request #31 from wusyong/ct
wusyong Mar 6, 2024
8d7ed20
Update release job to check remote tags
wusyong Mar 9, 2024
fb6869e
Simplify release job steps instead
wusyong Mar 9, 2024
a58bfe9
Revert latest commit
wusyong Mar 9, 2024
21f9113
Merge branch 'main' into mozjs_release
sagudev Mar 9, 2024
3809e36
Fix tag variable
wusyong Mar 9, 2024
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
55 changes: 47 additions & 8 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,19 @@ env:
RUST_BACKTRACE: 1
SHELL: /bin/bash
CARGO_INCREMENTAL: 0
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MOZJS_CREATE_ARCHIVE: 1

jobs:
mac:
runs-on: macos-13
strategy:
fail-fast: false
matrix:
features: ["--features debugmozjs", ""]
features: ["--features debugmozjs", "--features streams"]
platform:
- { target: aarch64-apple-darwin, os: macos-14 }
- { target: x86_64-apple-darwin, os: macos-13 }
runs-on: ${{ matrix.platform.os }}
env:
RUSTC_WRAPPER: sccache
CCACHE: sccache
Expand All @@ -41,6 +46,13 @@ jobs:
run: |
cargo build --verbose ${{ matrix.features }}
cargo test --tests --examples --verbose ${{ matrix.features }}
- name: Upload artifact
if: ${{ contains(matrix.features, '--features streams') }}
uses: actions/upload-artifact@v4
with:
path: ./target/libmozjs-${{ matrix.platform.target }}.tar.gz
name: libmozjs-${{ matrix.platform.target }}.tar.gz

linux:
env:
RUSTC_WRAPPER: "sccache"
Expand All @@ -50,7 +62,7 @@ jobs:
strategy:
fail-fast: false
matrix:
features: ["--features debugmozjs", ""]
features: ["--features debugmozjs", "--features streams"]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
Expand All @@ -65,18 +77,24 @@ jobs:
cargo test --tests --examples --verbose ${{ matrix.features }}
- name: Check wrappers integrity
# we generate wrappers only without debugmozjs
if: ${{ matrix.features == '' }}
if: ${{ matrix.features == '--features streams' }}
run: |
bash ./mozjs/src/generate_wrappers.sh
git diff --quiet --exit-code
- name: Upload artifact
if: ${{ contains(matrix.features, '--features streams') }}
uses: actions/upload-artifact@v4
with:
path: ./target/libmozjs-x86_64-unknown-linux-gnu.tar.gz
name: libmozjs-x86_64-unknown-linux-gnu.tar.gz

windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
features: ["--features debugmozjs", ""]
target: ["x86_64-pc-windows-msvc", "aarch64-pc-windows-msvc"]
features: ["--features debugmozjs", "--features streams"]
target: ["", "--target aarch64-pc-windows-msvc"]
env:
LINKER: "lld-link.exe"
CC: "clang-cl"
Expand All @@ -98,12 +116,18 @@ jobs:
- name: Build Windows
shell: cmd
run: |
cargo build --verbose --target ${{ matrix.target }} ${{ matrix.features }}
cargo build --verbose ${{ matrix.target }} ${{ matrix.features }}
- name: Test Windows
if: ${{ !contains(matrix.target, 'aarch64') }}
shell: cmd
run: |
cargo test --tests --examples --verbose --target ${{ matrix.target }} ${{ matrix.features }}
cargo test --tests --examples --verbose ${{ matrix.target }} ${{ matrix.features }}
- name: Upload artifact
if: ${{ !contains(matrix.target, 'aarch64') && contains(matrix.features, '--features streams') }}
uses: actions/upload-artifact@v4
with:
path: ./target/libmozjs-x86_64-pc-windows-msvc.tar.gz
name: libmozjs-x86_64-pc-windows-msvc.tar.gz

android:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -178,3 +202,18 @@ jobs:
- name: Mark the job as unsuccessful
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
run: exit 1

publish-release:
name: Publish release
runs-on: ubuntu-latest
needs: build_result
if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Publish release
run: |
RELEASE_TAG=$(date "+%F")
gh release create ${RELEASE_TAG} ./*.tar.gz
Loading