-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #455 from Ladicek/new-release-workflow
Use new release workflow with common SmallRye release actions
- Loading branch information
Showing
3 changed files
with
90 additions
and
78 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Jandex Prepare Release | ||
|
||
run-name: Prepare ${{github.event.inputs.tag || github.ref_name}} Release | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
paths: | ||
- '.github/project.yml' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
before-release: | ||
name: Before release | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.pull_request.merged == true}} | ||
|
||
steps: | ||
- name: Before release | ||
run: | | ||
java -version | ||
mvn --version | ||
git config --global user.name "SmallRye CI" | ||
git config --global user.email "[email protected]" | ||
sed -i -e 's|<version.jandex>.*</version.jandex>|<version.jandex>${{steps.metadata.outputs.current-version}}</version.jandex>|' benchmarks/pom.xml | ||
sed -i -e 's|^version: main|version: ${{steps.metadata.outputs.current-version}}|' doc/antora.yml | ||
git add -A . | ||
git commit -a -m 'Amendments before release' | ||
git push | ||
prepare-release: | ||
name: Prepare release | ||
needs: before-release | ||
if: ${{ github.event.pull_request.merged == true}} | ||
|
||
uses: smallrye/.github/.github/workflows/prepare-release.yml@main | ||
secrets: inherit | ||
|
||
after-release: | ||
name: After release | ||
runs-on: ubuntu-latest | ||
needs: prepare-release | ||
if: ${{ github.event.pull_request.merged == true}} | ||
|
||
steps: | ||
- name: After release | ||
run: | | ||
git config --global user.name "SmallRye CI" | ||
git config --global user.email "[email protected]" | ||
sed -i -e 's|<version.jandex>.*</version.jandex>|<version.jandex>${project.version}</version.jandex>|' benchmarks/pom.xml | ||
sed -i -e 's|^version: ${{steps.metadata.outputs.current-version}}|version: main|' doc/antora.yml | ||
git add -A . | ||
git commit -a -m 'Amendments after release' | ||
git push |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,37 @@ | ||
name: Jandex Release | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
paths: | ||
- '.github/project.yml' | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
if: ${{github.event.pull_request.merged == true}} | ||
env: | ||
GITHUB_TOKEN: ${{secrets.RELEASE_TOKEN}} | ||
|
||
steps: | ||
- name: Retrieve project metadata | ||
id: metadata | ||
uses: radcortez/project-metadata-action@main | ||
with: | ||
github-token: ${{secrets.GITHUB_TOKEN}} | ||
metadata-file-path: '.github/project.yml' | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{secrets.RELEASE_TOKEN}} | ||
run-name: Perform ${{github.event.inputs.tag || github.ref_name}} Release | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
server-id: 'oss.sonatype' | ||
server-username: 'MAVEN_DEPLOY_USERNAME' | ||
server-password: 'MAVEN_DEPLOY_TOKEN' | ||
gpg-private-key: ${{secrets.MAVEN_GPG_PRIVATE_KEY}} | ||
gpg-passphrase: 'MAVEN_GPG_PASSPHRASE' | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'Tag to release' | ||
required: true | ||
|
||
- name: Set up Maven | ||
uses: stCarolas/setup-maven@v5 | ||
with: | ||
maven-version: 3.8.7 | ||
permissions: | ||
attestations: write | ||
id-token: write | ||
contents: write | ||
|
||
- name: Maven release ${{steps.metadata.outputs.current-version}} | ||
env: | ||
MAVEN_DEPLOY_USERNAME: ${{secrets.MAVEN_DEPLOY_USERNAME}} | ||
MAVEN_DEPLOY_TOKEN: ${{secrets.MAVEN_DEPLOY_TOKEN}} | ||
MAVEN_GPG_PASSPHRASE: ${{secrets.MAVEN_GPG_PASSPHRASE}} | ||
run: | | ||
export MAVEN_OPTS="--add-opens=java.base/java.util=ALL-UNNAMED" | ||
java -version | ||
mvn --version | ||
git config --global user.name "SmallRye CI" | ||
git config --global user.email "[email protected]" | ||
git checkout -b release | ||
sed -i -e 's|<version.jandex>.*</version.jandex>|<version.jandex>${{steps.metadata.outputs.current-version}}</version.jandex>|' benchmarks/pom.xml | ||
sed -i -e 's|^version: main|version: ${{steps.metadata.outputs.current-version}}|' doc/antora.yml | ||
git commit -a -m 'Amendments before release' | ||
mvn -B release:prepare -Prelease -DreleaseVersion=${{steps.metadata.outputs.current-version}} -DdevelopmentVersion=${{steps.metadata.outputs.next-version}} | ||
git checkout ${{github.base_ref}} | ||
git rebase release | ||
mvn -B release:perform -Prelease | ||
sed -i -e 's|<version.jandex>.*</version.jandex>|<version.jandex>${project.version}</version.jandex>|' benchmarks/pom.xml | ||
sed -i -e 's|^version: ${{steps.metadata.outputs.current-version}}|version: main|' doc/antora.yml | ||
git commit -a -m 'Amendments after release' | ||
git push | ||
git push --tags | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
- name: Milestone release | ||
uses: radcortez/milestone-release-action@main | ||
with: | ||
github-token: ${{secrets.GITHUB_TOKEN}} | ||
milestone-title: ${{steps.metadata.outputs.current-version}} | ||
milestone-next: ${{steps.metadata.outputs.next-version}} | ||
jobs: | ||
perform-release: | ||
name: Perform Release | ||
uses: smallrye/.github/.github/workflows/perform-release.yml@main | ||
secrets: inherit | ||
with: | ||
version: ${{github.event.inputs.tag || github.ref_name}} | ||
|
||
github-pages: | ||
name: GitHub Pages | ||
needs: | ||
- release | ||
needs: perform-release | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
@@ -96,12 +48,12 @@ jobs: | |
- name: Generate and push | ||
run: | | ||
node --version | ||
curl -s -L -o antora-playbook.yml https://github.com/smallrye/jandex/blob/main/doc/antora-playbook-prod.yml?raw=true | ||
npm install @antora/[email protected] @antora/[email protected] | ||
npx antora generate antora-playbook.yml | ||
rm -rf node_modules docs package.json package-lock.json antora-playbook.yml | ||
mv -T build/site docs | ||
touch docs/.nojekyll | ||
|
8 changes: 5 additions & 3 deletions
8
.github/workflows/pre-release.yml → .github/workflows/review-release.yml
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