Release 4.0.0 ? #33
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: Release | |
env: | |
MAVEN_ARGS: -B -e | |
on: | |
workflow_dispatch: | |
pull_request: | |
types: [closed] | |
paths: | |
- '.github/project.yml' | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
name: release | |
steps: | |
- uses: actions/checkout@v2 | |
name: Checkout | |
- uses: radcortez/project-metadata-action@main | |
name: Retrieve project metadata | |
id: metadata | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
metadata-file-path: '.github/project.yml' | |
local-file: true | |
- name: Setup Java | |
uses: actions/setup-java@v2 | |
with: | |
java-version: 8 | |
distribution: 'temurin' | |
server-id: oss-sonatype-staging | |
server-username: OSS_SONATYPE_USERNAME | |
server-password: OSS_SONATYPE_PASSWORD | |
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
- name: Configure Git author | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
- name: Maven release ${{steps.metadata.outputs.current-version}} | |
run: | | |
./mvnw clean install -DskipTests | |
git checkout -b release | |
./mvnw -X -Prelease -B release:clean release:prepare -DreleaseVersion=${{steps.metadata.outputs.current-version}} -DdevelopmentVersion=${{steps.metadata.outputs.next-version}} -Pwith-examples,with-tests,with-knative-examples,with-gradle-examples,with-dockerio,with-internal-registry,with-service-binding-examples,with-kubernetes-specific-examples,with-openshift-specific-examples | |
git checkout ${{github.base_ref}} | |
git rebase release | |
./mvnw -X -Prelease -B release:perform -DskipTests | |
# update readme.md | |
docker run -v `pwd`:/ws --workdir=/ws -i quay.io/jbangdev/jbang-action ./scripts/ChangeVersion.java readme.md io.dekorate ${{steps.metadata.outputs.next-version}} | tail -n +3 > readme.md.versionChanged | |
mv readme.md.versionChanged readme.md | |
# update site version | |
cp .github/project.yml docs/_data/project.yml | |
git add --all | |
# commit changes | |
git commit -m "chore: Set docs, examples and tests version to ${{steps.metadata.outputs.current-version}}" | |
env: | |
OSS_SONATYPE_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }} | |
OSS_SONATYPE_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} | |
- name: Push changes to ${{github.base_ref}} | |
uses: ad-m/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{github.base_ref}} | |
force: true | |
- name: Push tags | |
uses: ad-m/[email protected] | |
with: | |
branch: ${{github.base_ref}} | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
tags: true | |
force_with_lease: true |