Update tokens #17
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
| # This workflow uses actions that are not certified by GitHub. | |
| # They are provided by a third-party and are governed by | |
| # separate terms of service, privacy policy, and support | |
| # documentation. | |
| # This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time | |
| # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle | |
| name: Build Application | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - master | |
| concurrency: | |
| group: build | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| architecture: [x64] | |
| # architecture: [x64, aarch64] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Pre-build shell for POSIX | |
| if: runner.os != 'Windows' | |
| run: | | |
| ls -al | |
| chmod +x gradlew | |
| ./gradlew --version | |
| - name: Pre-build shell for Linux | |
| shell: bash | |
| if: runner.os == 'Linux' || runner.os == 'Ubuntu' || runner.os == 'CentOS' | |
| run: | | |
| set +e | |
| sudo apt-get update | |
| # sudo apt-get install --install-suggests -y musl musl-tools zlib1g-dev | |
| # Specify an installation directory for musl: | |
| export MUSL_HOME=$PWD/musl-toolchain | |
| # Download musl and zlib sources: | |
| curl -O https://musl.libc.org/releases/musl-1.2.4.tar.gz | |
| curl -O https://zlib.net/fossils/zlib-1.2.13.tar.gz | |
| # Build musl from source | |
| tar -xzvf musl-1.2.4.tar.gz | |
| pushd musl-1.2.4 | |
| ./configure --prefix=$MUSL_HOME --static | |
| # The next operation may require privileged access to system resources, so use sudo | |
| sudo make | |
| sudo make install | |
| popd | |
| # Install a symlink for use by native-image | |
| sudo ln -s $MUSL_HOME/bin/musl-gcc $MUSL_HOME/bin/x86_64-linux-musl-gcc | |
| sudo ln -s $MUSL_HOME/bin/musl-gcc $MUSL_HOME/bin/aarch64-linux-musl-gcc | |
| sudo chmod -R +r "$MUSL_HOME" | |
| sudo chmod -R +w "$MUSL_HOME" | |
| # Extend the system path and confirm that musl is available by printing its version | |
| export PATH="$MUSL_HOME/bin:$PATH" | |
| echo "$MUSL_HOME/bin" >> $GITHUB_PATH | |
| x86_64-linux-musl-gcc --version | |
| # Build zlib with musl from source and install into the MUSL_HOME directory | |
| tar -xzvf zlib-1.2.13.tar.gz | |
| pushd zlib-1.2.13 | |
| CC=$MUSL_HOME/bin/musl-gcc ./configure --prefix=$MUSL_HOME --static | |
| sudo make | |
| sudo make install | |
| sudo chmod -R +r "$MUSL_HOME" | |
| sudo chmod -R +w "$MUSL_HOME" | |
| popd | |
| true | |
| - name: Pre-build shell for Windows | |
| if: runner.os == 'Windows' | |
| run: | | |
| ls | |
| .\gradlew.bat --version | |
| - name: Set up GraalVM | |
| uses: graalvm/setup-graalvm@v1 | |
| with: | |
| java-version: '21' | |
| distribution: 'graalvm' | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| components: 'native-image' | |
| - name: Set up Gradle | |
| uses: gradle/gradle-build-action@v2 | |
| with: | |
| gradle-version: '8.8' | |
| - name: Build native image | |
| run: ./gradlew nativeCompile | |
| - name: Build universal shadow JAR | |
| shell: bash | |
| if: runner.os == 'Linux' && runner.arch == 'x64' | |
| run: | | |
| ./gradlew shadowJar | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: native-image-${{ matrix.os }}-${{ matrix.architecture }} | |
| path: | | |
| build/native/nativeCompile/* | |
| build/libs/* | |
| if-no-files-found: error | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: ./artifacts | |
| - name: Create or Update Release | |
| id: create_release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: Release ${{ github.ref_name }} | |
| draft: false | |
| prerelease: false | |
| overwrite: true | |
| files: ./artifacts/** | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.REL_GITHUB_TOKEN }} |