Merge pull request #399 from PerimeterX/release/v6.14.1 #7
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
name: CD | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
extract_version: | |
runs-on: ubuntu-latest | |
name: Extract release version | |
outputs: | |
version: ${{ steps.version.outputs.value }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
- name: Get package version | |
id: version | |
run: echo "value=$(node -p -e "require('./px_metadata.json').version")" >> "$GITHUB_OUTPUT" | |
create_release: | |
runs-on: ubuntu-latest | |
needs: extract_version | |
name: Create release on GitHub | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- run: gh release create v${{ needs.extract_version.outputs.version }} --generate-notes -t "Version ${{ needs.extract_version.outputs.version }}" | |
env: | |
GITHUB_TOKEN: ${{ github.TOKEN }} | |
shell: bash | |
name: Creates a release in GitHub | |
publish: | |
name: Deploy to maven | |
needs: | |
- create_release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up JDK 8 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '8' | |
distribution: 'adopt' | |
- name: Import GPG key | |
run: echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --import | |
env: | |
# To generate a new GPG key run the following command in your local terminal: | |
# gpg --export-secret-keys -a "<key_id>" | base64 | |
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} | |
- name: Log GPG keys | |
run: gpg --list-secret-keys --keyid-format LONG | |
- name: Deploy a new version | |
run: mvn clean deploy -P build-extras,sign --settings deploy/mvnsettings.xml | |
env: | |
GPG_KEY_NAME: ${{ vars.GPG_KEY_NAME }} | |
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
OSSRH_JIRA_USERNAME: ${{ secrets.OSSRH_JIRA_USERNAME }} | |
OSSRH_JIRA_PASSWORD: ${{ secrets.OSSRH_JIRA_PASSWORD }} |