Skip to content

Commit

Permalink
Add custom linkers for cross compile builds
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlAmko committed Jul 26, 2023
1 parent 6864687 commit 91db274
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 12 deletions.
35 changes: 25 additions & 10 deletions .github/workflows/release-perform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,34 +21,42 @@ jobs:
- host: ubuntu-latest
target: i686-unknown-linux-gnu
artifact: linux-x86
cross: true
linker: gcc-multilib
pkgFlags: "--define 'skipTests'"
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact: linux-x86_64
- host: ubuntu-latest
target: aarch64-unknown-linux-gnu
artifact: linux-aarch64
cross: true
linker: gcc-aarch64-linux-gnu
pkgFlags: "--define 'skipTests'"
- host: ubuntu-latest
target: aarch64-linux-android
artifact: linux-android-aarch64
cross: true
linker: gcc-aarch64-linux-gnu
pkgFlags: "--define 'skipTests'"
- host: ubuntu-latest
target: armv7-linux-androideabi
artifact: linux-android-armv7
cross: true
linker: gcc-arm-linux-gnueabihf
pkgFlags: "--define 'skipTests'"
- host: windows-latest
target: x86_64-pc-windows-msvc
artifact: windows-x86_64
- host: windows-latest
target: i686-pc-windows-msvc
target: i686-pc-windows-msvc
artifact: windows-x86_32
pkgFlags: "--define 'skipTests'"
- host: macos-latest
target: x86_64-apple-darwin
target: x86_64-apple-darwin
artifact: osx-x86_64
- host: macos-latest
target: aarch64-apple-darwin
target: aarch64-apple-darwin
artifact: osx-aarch64
pkgFlags: "--define 'skipTests'"
runs-on: ${{ matrix.config.host }}
Expand All @@ -61,13 +69,20 @@ jobs:
toolchain: stable
targets: ${{ matrix.config.target }}
- uses: ./.github/workflows/rust-cache
- uses: actions/setup-java@v3
- name: Install Linker
run: |
sudo apt update
sudo apt install ${{ matrix.config.linker }}
if: ${{ matrix.config.cross }}
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Run mvn package native
java-version: "11"
distribution: "temurin"
- name: Run mvn package for native
run: mvn --batch-mode --projects ngrok-java-native --also-make package --activate-profiles ci-native --define 'ngrok.native.classifier=${{ matrix.config.artifact }}' --define 'ngrok.native.target=${{ matrix.config.target }}' ${{ matrix.config.pkgFlags }}
- uses: actions/upload-artifact@v3
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: ngrok-java-native-${{ github.event.inputs.releaseVersion }}-${{ matrix.config.artifact }}.jar
path: ngrok-java-native/target/ngrok-java-native-${{ github.event.inputs.releaseVersion }}-${{ matrix.config.artifact }}.jar
Expand All @@ -87,7 +102,7 @@ jobs:
java-version: |
17
11
distribution: 'temurin'
distribution: "temurin"
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
Expand Down Expand Up @@ -117,7 +132,7 @@ jobs:
java-version: |
17
11
distribution: 'temurin'
distribution: "temurin"
- uses: actions/download-artifact@v3
with:
path: ngrok-java-native/target/
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/rust-cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ runs:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('SCCACHE_GHA_CACHE_TO', 'sccache-${{runner.os}}-${{github.ref_name}}');
core.exportVariable('SCCACHE_GHA_CACHE_FROM', 'sccache-${{runner.os}}-main,sccache-${{runner.os}}-');
core.exportVariable('SCCACHE_GHA_CACHE_TO', 'sccache-${{ runner.os }}-${{ github.ref_name }}');
core.exportVariable('SCCACHE_GHA_CACHE_FROM', 'sccache-${{ runner.os }}-main,sccache-${{ runner.os }}-');
- name: cargo registry cache
uses: actions/cache@v3
with:
Expand Down

0 comments on commit 91db274

Please sign in to comment.