-
Notifications
You must be signed in to change notification settings - Fork 11
use gha instead of circleci #54
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,276 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| tags: | ||
| - '[0-9]+.[0-9]+.[0-9]+' | ||
| - '[0-9]+.[0-9]+.[0-9]+-**' | ||
| pull_request: | ||
| branches: | ||
| - master | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| GRADLE_OPTS: -Xmx2048m -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=2 | ||
|
|
||
| jobs: | ||
| x86-64-linux-build: | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| SKIP_GRADLE: true | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| submodules: recursive | ||
|
|
||
| - name: Install Swig4 | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y automake autoconf libpcre2-dev bison flex | ||
| curl -L -O https://github.com/swig/swig/archive/v4.4.1.tar.gz | ||
| tar -xzvf v4.4.1.tar.gz | ||
| cd swig-4.4.1/ | ||
| sh autogen.sh | ||
| ./configure | ||
| make | ||
| sudo make install | ||
|
cursor[bot] marked this conversation as resolved.
|
||
|
|
||
| - name: Build Linux AMD Library | ||
| run: | | ||
| cd blst/bindings/java | ||
| ../../build.sh -D__BLST_PORTABLE__ | ||
| ./run.me | ||
|
|
||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: linux-x86-64-native | ||
| path: blst/bindings/java/supranational/ | ||
|
|
||
| arm64-linux-build: | ||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
| runs-on: ubuntu-latest | ||
| env: | ||
| SKIP_GRADLE: true | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| submodules: recursive | ||
|
|
||
| - name: Install Swig4 | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y automake autoconf libpcre2-dev bison flex | ||
| curl -L -O https://github.com/swig/swig/archive/v4.4.1.tar.gz | ||
| tar -xzvf v4.4.1.tar.gz | ||
| cd swig-4.4.1/ | ||
|
joshuafernandes marked this conversation as resolved.
|
||
| sh autogen.sh | ||
| ./configure | ||
| make | ||
| sudo make install | ||
|
|
||
| - name: Install Cross Compiler | ||
| run: sudo apt-get install -y gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu g++-aarch64-linux-gnu | ||
|
|
||
| - name: Generate ARM library | ||
| run: | | ||
| cd blst/bindings/java | ||
| export CROSS_COMPILE=aarch64-linux-gnu- | ||
| export CXX=aarch64-linux-gnu-g++ | ||
| ../../build.sh -D__BLST_PORTABLE__ | ||
| ./build.sh | ||
| # arch is determined in Java based on the current CPU but we're cross compiling, so need to rename | ||
| mv supranational/blst/Linux/* supranational/blst/Linux/aarch64 | ||
|
|
||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: linux-arm64-native | ||
| path: blst/bindings/java/supranational/blst/Linux/ | ||
|
|
||
| mac-os-build: | ||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
| runs-on: macos-latest | ||
| env: | ||
| SKIP_GRADLE: true | ||
| HOMEBREW_NO_AUTO_UPDATE: true | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| submodules: recursive | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| brew install swig | ||
| brew install gnu-sed | ||
|
|
||
| - name: Generate macOS shared lib | ||
| run: | | ||
| cd blst/bindings/java | ||
| rm -rf libblst.a supranational.blst.jar supranational | ||
|
|
||
| echo "Building for x86" | ||
| export CC="cc -arch x86_64" | ||
| export CXX="c++ -arch x86_64 -std=c++11" | ||
| ../../build.sh "-D__BLST_PORTABLE__" | ||
| ./build.sh | ||
| # os.arch of this JVM is aarch64, but we cross compiled so move to the right directory | ||
| mv supranational/blst/Mac/aarch64 supranational/blst/Mac/x86_64 | ||
|
|
||
| echo "Building for arm64" | ||
| rm -rf libblst.a supranational.blst.jar | ||
| export CC="cc" | ||
| export CXX="c++ -std=c++11" | ||
| ../../build.sh "-D__BLST_PORTABLE__" | ||
| ./run.me | ||
|
|
||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: macos-native | ||
| path: blst/bindings/java/supranational/blst/Mac/ | ||
|
|
||
| windows-build: | ||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
| runs-on: windows-latest | ||
| env: | ||
| SKIP_GRADLE: true | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| submodules: recursive | ||
|
|
||
| - name: Install dependencies | ||
| shell: powershell | ||
| run: | | ||
| $ErrorActionPreference = 'SilentlyContinue' | ||
| choco install archiver --force --x64 | ||
| choco install 7zip --force --x64 | ||
| choco install swig | ||
|
|
||
| - name: Install TDM GCC | ||
| shell: powershell | ||
| run: | | ||
| New-Item -ItemType Directory -Force -Path tdm | Out-Null | ||
| Set-Location tdm | ||
| curl.exe -L -o tdm64-gcc-10.3.0-2.exe https://github.com/jmeubank/tdm-gcc/releases/download/v10.3.0-tdm64-2/tdm64-gcc-10.3.0-2.exe | ||
| 7z e tdm64-gcc-10.3.0-2.exe | ||
| New-Item -ItemType Directory -Force -Path install | Out-Null | ||
| Get-ChildItem -Filter *.tar.xz | ForEach-Object { | ||
| arc -folder-safe=false unarchive $_.FullName install | ||
| } | ||
|
|
||
| - name: Generate Windows shared lib | ||
| shell: powershell | ||
| run: | | ||
| $Env:PATH = "$PWD\tdm\install\bin;$Env:PATH" | ||
| Set-Location blst\bindings\java | ||
| sh .\run.me -D__BLST_PORTABLE__ | ||
| if (-not $?) { | ||
| throw 'Build or Tests failed' | ||
| } | ||
|
|
||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: windows-native | ||
| path: blst/bindings/java/supranational/blst/Windows/ | ||
|
|
||
| assemble: | ||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
| runs-on: ubuntu-latest | ||
| needs: [x86-64-linux-build, arm64-linux-build, mac-os-build, windows-build] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
cursor[bot] marked this conversation as resolved.
|
||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'temurin' | ||
|
|
||
| - name: Download Linux x86_64 native | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: linux-x86-64-native | ||
| path: blst/bindings/java/supranational/ | ||
|
|
||
| - name: Download Linux ARM64 native | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: linux-arm64-native | ||
| path: blst/bindings/java/supranational/blst/Linux/ | ||
|
|
||
| - name: Download macOS native | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: macos-native | ||
| path: blst/bindings/java/supranational/blst/Mac/ | ||
|
|
||
| - name: Download Windows native | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: windows-native | ||
| path: blst/bindings/java/supranational/blst/Windows/ | ||
|
|
||
| - name: Copy BLST Sources | ||
| run: | | ||
| cd blst/bindings/java/ | ||
| SRCDIR="../../../src/main/java/supranational/blst" | ||
| RESOURCEDIR="../../../src/main/resources/supranational/blst" | ||
| mkdir -p "$SRCDIR" "$RESOURCEDIR" | ||
| cp supranational/blst/*.java "$SRCDIR" | ||
| cp -r supranational/blst/Linux "$RESOURCEDIR" | ||
| cp -r supranational/blst/Mac "$RESOURCEDIR" | ||
| cp -r supranational/blst/Windows "$RESOURCEDIR" | ||
|
|
||
| - name: Build Jar | ||
| run: ./gradlew --no-daemon --parallel build | ||
|
|
||
| - name: Check Jar | ||
| run: ./gradlew --no-daemon checkJarContents | ||
|
|
||
| - name: Store Jar | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: jar | ||
| path: build/libs/ | ||
|
|
||
| - name: Store assembled workspace | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: assembled-workspace | ||
| path: | | ||
| src/ | ||
| build/ | ||
|
|
||
| # check on checkResources.sh loses - it may need permissions to +x | ||
| publish: | ||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
| runs-on: ubuntu-latest | ||
| environment: publish | ||
| needs: assemble | ||
| if: >- | ||
| github.ref == 'refs/heads/master' || | ||
| startsWith(github.ref, 'refs/heads/release-') || | ||
| startsWith(github.ref, 'refs/tags/') | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| submodules: recursive | ||
|
|
||
| - uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: '17' | ||
| distribution: 'temurin' | ||
|
|
||
| - name: Download assembled workspace | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: assembled-workspace | ||
| path: . | ||
|
|
||
| - name: Publish to Cloudsmith | ||
| env: | ||
| CLOUDSMITH_USER: ${{ secrets.CLOUDSMITH_USER }} | ||
| CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }} | ||
| run: | | ||
| ./gradlew --no-daemon --parallel checkJarContents publish | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Release branches never trigger CI
Medium Severity
The workflow
on.push.brancheslist only includesmaster, but thepublishjobifstill allowsrefs/heads/release-*. Pushes to release branches never start the workflow, so that publish path from the old CircleCI filters is unreachable.Additional Locations (1)
.github/workflows/ci.yml#L241-L245Reviewed by Cursor Bugbot for commit 77a7bc3. Configure here.