Skip to content

Merge release into master branch #12

Merge release into master branch

Merge release into master branch #12

Workflow file for this run

name: Release
on:
pull_request:
branches:
- master
types: [closed]
env:
artifactId: koryphe
MAVEN_OPTS: -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=25
jobs:
deploy-release:
if: ${{ github.event.pull_request.merged }}
runs-on: ubuntu-latest
outputs:
release_version: ${{ steps.release-version.outputs.release_version }}
steps:
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '11'
- name: Checkout master
uses: actions/checkout@v4
with:
ref: master
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
fetch-depth: 0
- name: Set up Github credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Output release version
id: release-version
run: |
echo "release_version=$(mvn -q help:evaluate -DforceStdout -Dexpression=pom.version)" >> $GITHUB_OUTPUT
generate-javadoc:
runs-on: ubuntu-latest
needs:
- deploy-release
steps:
- name: Checkout master
uses: actions/checkout@v4
with:
ref: master
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
- name: Set up Github credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Setup JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
- name: Set version
run: echo "RELEASE_VERSION=$(echo ${{ needs.deploy-release.outputs.release_version }})" >> $GITHUB_ENV
- name: Upload Javadoc
run: |
git remote set-branches --add origin gh-pages
git pull
mvn -q javadoc:aggregate
git checkout gh-pages
rm -rf uk
rm -rf jquery
rm -rf resources
mv target/site/apidocs/* .
git add .
git commit -a -m "Updated javadoc - $RELEASE_VERSION"
git push
release-to-nexus:
runs-on: ubuntu-latest
needs:
- deploy-release
steps:
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '11'
- name: Checkout master
uses: actions/checkout@v4
with:
ref: master
- name: Decode CodeSigning key
env:
CODE_SIGNING_KEY: ${{ secrets.CODE_SIGNING_KEY }}
CODE_SIGNING_IV: ${{ secrets.CODE_SIGNING_IV }}
run: openssl aes-256-cbc -K "$CODE_SIGNING_KEY" -iv "$CODE_SIGNING_IV" -in cd/codesigning.asc.enc -out cd/codesigning.asc -d
- name: Import CodeSigning key
run: gpg --batch --fast-import cd/codesigning.asc
- name: Release to Nexus
env:
GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
OSS_NEXUS_USERNAME: ${{ secrets.OSS_NEXUS_USERNAME }}
OSS_NEXUS_PASSWORD: ${{ secrets.OSS_NEXUS_PASSWORD }}
run: mvn deploy -P quick,ossrh-release --settings cd/mvnsettings.xml -B
update-github-releases:
runs-on: ubuntu-latest
needs:
- deploy-release
steps:
- name: Checkout Master
uses: actions/checkout@v4
with:
ref: master
- name: Set version
run: echo "RELEASE_VERSION=$(echo ${{ needs.deploy-release.outputs.release_version }})" >> $GITHUB_ENV
- name: Create release notes
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag_name: ${{ env.artifactId }}-${{ env.RELEASE_VERSION }}
name: Koryphe ${{ env.RELEASE_VERSION }}
update-develop:
runs-on: ubuntu-latest
needs:
- deploy-release
steps:
- name: Checkout develop
uses: actions/checkout@v4
with:
ref: develop
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
fetch-depth: 0
- name: Set up Github credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Setup JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
- name: Merge master into develop
run: |
git merge origin/master
- name: Update develop branch
run: |
git checkout develop
mvn release:update-versions -B
git commit -a -m "prepare for next development iteration"
git push