Merge pull request #3 from carlos7ags/carlos7ags/v0.7.1-bindings #5
Workflow file for this run
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
| name: Release | |
| on: | |
| push: | |
| tags: ['v*'] | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: 22 | |
| - uses: gradle/actions/setup-gradle@v4 | |
| - name: Set version from tag | |
| run: | | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| sed -i "s/version = \".*\"/version = \"$VERSION\"/" lib/build.gradle.kts | |
| echo "VERSION=$VERSION" >> $GITHUB_ENV | |
| - name: Verify native libraries | |
| run: | | |
| for platform in macos-aarch64 macos-x86_64 linux-x86_64 linux-aarch64 windows-x86_64; do | |
| dir="lib/src/main/resources/natives/$platform" | |
| if [ -z "$(ls -A $dir 2>/dev/null)" ]; then | |
| echo "ERROR: No native library found in $dir" | |
| exit 1 | |
| fi | |
| done | |
| echo "All native libraries present." | |
| - name: Build and test | |
| run: ./gradlew build | |
| - name: Publish to Maven Central | |
| run: ./gradlew publishToMavenCentral --no-configuration-cache | |
| env: | |
| ORG_GRADLE_PROJECT_mavenCentralToken: ${{ secrets.MAVEN_CENTRAL_TOKEN }} | |
| ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SIGNING_KEY }} | |
| ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_SIGNING_PASSWORD }} | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| files: | | |
| lib/build/libs/*.jar |