release #6
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: | |
| workflow_dispatch: | |
| inputs: | |
| release-version: | |
| description: 'Version being released' | |
| required: true | |
| branch: | |
| description: 'Branch to release from' | |
| required: true | |
| default: 'main' | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 11 | |
| distribution: 'temurin' | |
| server-id: central | |
| server-username: MAVEN_USERNAME | |
| server-password: MAVEN_CENTRAL_TOKEN | |
| gpg-private-key: ${{ secrets.java_gpg_secret_key }} | |
| gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
| - id: install-secret-key | |
| name: Install gpg secret key | |
| run: | | |
| cat <(echo -e "${{ secrets.java_gpg_secret_key }}") | gpg --batch --import | |
| gpg --list-secret-keys --keyid-format LONG | |
| - name: Set up Rust | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| - name: Build the Javy plugin | |
| working-directory: javy-plugin | |
| run: | | |
| rustup target add wasm32-wasip1 | |
| make build | |
| - name: Compile | |
| run: mvn --batch-mode clean install -DskipTests | |
| - name: Setup Git | |
| run: | | |
| git config --global user.name "GitHub Actions" | |
| git config --global user.email "actions@github.com" | |
| - name: Set the version | |
| run: | | |
| mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${{ github.event.inputs.release-version }} | |
| git add . | |
| git commit -m "Release version update ${{ github.event.inputs.release-version }}" | |
| git push | |
| git tag ${{ github.event.inputs.release-version }} | |
| git push origin ${{ github.event.inputs.release-version }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Release to Maven Central | |
| run: | | |
| mvn --batch-mode deploy -Prelease -DskipTests=true | |
| env: | |
| MAVEN_USERNAME: ${{ secrets.central_username }} | |
| MAVEN_CENTRAL_TOKEN: ${{ secrets.central_password }} | |
| MAVEN_GPG_PASSPHRASE: ${{ secrets.java_gpg_passphrase }} | |
| - name: Back to Snapshot | |
| run: | | |
| mvn versions:set -DgenerateBackupPoms=false -DnewVersion=999-SNAPSHOT | |
| git add . | |
| git commit -m "Snapshot version update" | |
| git push | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |