netbeans-nbm-deploy #23
This file contains 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 will build a Java project with Ant | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-ant | |
name: netbeans-nbm-deploy | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
environment: RELEASE180 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '8' | |
distribution: 'temurin' | |
server-id: ossrh | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import | |
gpg-passphrase: GPG_PASSPHRASE # env variable for GPG private key passphrase | |
- name : get version | |
run: echo "::set-output name=version::$(grep 'OpenIDE-Module-Specification-Version' ./manifest.mf | cut -d':' -f 2-)" | |
id: nbm_version | |
- name: view version | |
run: echo ${{ steps.nbm_version.outputs.version }} | |
- name : prepare the files from project | |
run : mkdir -p nb-plugin-package/src/main/java | |
- name : prepare the files from project | |
run : mkdir -p nb-plugin-package/src/main/nbm | |
- name : prepare the files from project | |
run : mkdir -p nb-plugin-package/src/main/resources/org/netbeans/modules/php/blade | |
- name : prepare the files from project | |
run : cp -rf ./src/org nb-plugin-package/src/main/java | |
- name : prepare the files from project | |
run : cp -rf ./src/org/netbeans/modules/php/blade/resources nb-plugin-package/src/main/resources/org/netbeans/modules/php/blade | |
- name : prepare the files from project | |
run : cp ./manifest.mf nb-plugin-package/src/main/nbm/manifest.mf | |
- name : prepare the files from project | |
run : cp ./.github/deploy/pom.xml nb-plugin-package/pom.xml | |
- name : prepare the files from project | |
run : cp ./nbproject/project.properties nb-plugin-package/project.properties | |
- name : prepare the files from project | |
run : cp ./LICENSE nb-plugin-package/LICENSE | |
- name : Install gpg secret key v1 | |
run : | | |
# Install gpg secret key | |
cat <(echo -e "${{ secrets.MAVEN_GPG_PRIVATE_KEY }}") | gpg --batch --import | |
# Verify gpg secret key | |
gpg --version && gpg --list-secret-keys --keyid-format LONG && export GPG_TTY=$(tty) | |
# - name: Import GPG Key | |
# uses: crazy-max/ghaction-import-gpg@v1 | |
env: | |
GPG_PRIVATE_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} | |
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
- name : Publish package | |
working-directory: ./nb-plugin-package | |
env: | |
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | |
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
MAVEN_GPG_PRIVATE_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import | |
run : | | |
gpg --list-keys && \ | |
mvn deploy\ | |
--no-transfer-progress \ | |
-Dgpg.passphrase=${{ secrets.MAVEN_GPG_PRIVATE_KEY }} \ | |
--batch-mode |