Merge pull request #31 from HHS/bugfix/metainfo-report-generator #34
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 Maven, and cache/restore any dependencies to improve the workflow execution time | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven | |
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
name: Util Release Build | |
on: | |
push: | |
paths-ignore: | |
- 'README.md' | |
- 'LICENSE' | |
branches: ["main"] | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
outputs: | |
util_version: ${{ steps.version-string.outputs.util_version }} | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout Util | |
uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
server-id: central | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
gpg-private-key: ${{ secrets.GPG_SECRET_KEY }} | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
- name: Build and Deploy Util | |
run: mvn clean deploy -Pjavadoc,sign --file pom.xml | |
env: | |
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_TOKEN }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_SECRET_KEY_PASSWORD }} | |
- name: Get Util Version | |
id: version-string | |
run: | | |
echo "version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout --file pom.xml)" >> "$GITHUB_ENV" | |
echo "util_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout --file pom.xml)" >> "$GITHUB_OUTPUT" | |
- name: Make Util Release | |
uses: ncipollo/[email protected] | |
with: | |
artifacts: "target/util-${{ env.version }}*" | |
name: "v${{ env.version }}" | |
tag: "v${{ env.version }}" | |
generateReleaseNotes: true | |
skipIfReleaseExists: true | |
update-gcm: | |
needs: release | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
env: | |
VERSION: ${{ needs.release.outputs.util_version }} | |
steps: | |
- name: Checkout GCM | |
uses: actions/checkout@v4 | |
with: | |
repository: HHS/ASPR-8 | |
token: ${{ secrets.GHA_BOT }} | |
- name: Update Util version | |
run : | | |
echo "$VERSION" | |
sed -i "0,/<util.version>.*<\/util.version>/s//<util.version>$VERSION<\/util.version>/g" pom.xml | |
- name: Increment GCM Version | |
run: | | |
current_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout --file pom.xml) | |
echo GCM Version: $current_version | |
parts=( ${current_version//./ } ) | |
bv=$((parts[2] + 1)) | |
new_version="${parts[0]}.${parts[1]}.${bv}" | |
echo New GCM Version: $new_version | |
sed -i "0,/<revision>.*<\/revision>/s//<revision>$new_version<\/revision>/g" pom.xml | |
- name: Setup Git | |
run: | | |
git config --global user.name "github-actions" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
- name: Make branch in GCM | |
run: | | |
git checkout -b update-util-to-$VERSION | |
git add pom.xml | |
git commit -m "Update util to $VERSION" | |
git push --set-upstream origin update-util-to-$VERSION | |
- name: Make PR in GCM | |
run: | | |
gh pr create -R HHS/ASPR-8 -B main --fill | |
gh pr merge -m --auto | |
env: | |
GH_TOKEN: ${{ secrets.GHA_BOT }} | |
update-taskit: | |
needs: release | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
env: | |
VERSION: ${{ needs.release.outputs.util_version }} | |
steps: | |
- name: Checkout GCM | |
uses: actions/checkout@v4 | |
with: | |
repository: HHS/ASPR-ms-taskit | |
token: ${{ secrets.GHA_BOT }} | |
- name: Update Util version | |
run : | | |
echo "$VERSION" | |
sed -i "0,/<util.version>.*<\/util.version>/s//<util.version>$VERSION<\/util.version>/g" pom.xml | |
- name: Increment Taskit Version | |
run: | | |
current_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout --file pom.xml) | |
echo Taskit Version: $current_version | |
parts=( ${current_version//./ } ) | |
bv=$((parts[2] + 1)) | |
new_version="${parts[0]}.${parts[1]}.${bv}" | |
echo New Taskit Version: $new_version | |
sed -i "0,/<revision>.*<\/revision>/s//<revision>$new_version<\/revision>/g" pom.xml | |
- name: Setup Git | |
run: | | |
git config --global user.name "github-actions" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
- name: Make branch in Taskit | |
run: | | |
git checkout -b update-util-to-$VERSION | |
git add pom.xml | |
git commit -m "Update util to $VERSION" | |
git push --set-upstream origin update-util-to-$VERSION | |
- name: Make PR in Taskit | |
run: | | |
gh pr create -R HHS/ASPR-ms-taskit -B main --fill | |
gh pr merge -m --auto | |
env: | |
GH_TOKEN: ${{ secrets.GHA_BOT }} |