Skip to content

Commit

Permalink
Update release script (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi authored Apr 18, 2023
1 parent 9bde18c commit bb073e9
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 94 deletions.
Binary file removed .github/release/maven-settings.xml.gpg
Binary file not shown.
73 changes: 33 additions & 40 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build
on:
push:
branches:
- "master"
- "main"
paths-ignore:
- '.gitignore'
- 'CODEOWNERS'
Expand All @@ -13,7 +13,6 @@ on:
- '*.txt'
- '.all-contributorsrc'
pull_request:
types: [opened, synchronize, reopened]
paths-ignore:
- '.gitignore'
- 'CODEOWNERS'
Expand All @@ -23,44 +22,38 @@ on:
- '*.txt'
- '.all-contributorsrc'

jobs:
build:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

runs-on: ubuntu-latest
defaults:
run:
shell: bash

jobs:
build:
name: Build on ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# os: [windows-latest, macos-latest, ubuntu-latest]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11

# - name: Cache SonarCloud packages
# uses: actions/cache@v1
# with:
# path: ~/.sonar/cache
# key: ${{ runner.os }}-sonar
# restore-keys: ${{ runner.os }}-sonar

- name: Get Date
id: get-date
run: |
echo "::set-output name=date::$(/bin/date -u "+%Y-%m")"
shell: bash
- name: Cache Maven Repository
id: cache-maven
uses: actions/cache@v2
with:
path: ~/.m2/repository
# refresh cache every month to avoid unlimited growth
key: maven-repo-${{ runner.os }}-${{ steps.get-date.outputs.date }}

- name: Build and analyze
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

run: mvn -B -Pnative impsort:check formatter:validate verify # org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
- name: Prepare git
run: git config --global core.autocrlf false
if: startsWith(matrix.os, 'windows')

- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
cache: 'maven'

- name: Build with Maven
run: mvn -B clean install -Dno-format

- name: Build with Maven (Native)
run: mvn -B install -Dnative -Dquarkus.native.container-build -Dnative.surefire.skip
8 changes: 8 additions & 0 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ on:
paths:
- '.github/project.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash

jobs:
release:
runs-on: ubuntu-latest
Expand Down
29 changes: 20 additions & 9 deletions .github/workflows/quarkus-snapshot.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: "Quarkus ecosystem CI"
on:
workflow_dispatch:
watch:
types: [started]

# For this CI to work, ECOSYSTEM_CI_TOKEN needs to contain a GitHub with rights to close the Quarkus issue that the user/bot has opened,
# while 'ECOSYSTEM_CI_REPO_PATH' needs to be set to the corresponding path in the 'quarkusio/quarkus-ecosystem-ci' repository
# For this CI to work, ECOSYSTEM_CI_TOKEN needs to contain a GitHub with rights to close the Quarkus issue that the user/bot has opened,
# while 'ECOSYSTEM_CI_REPO_PATH' needs to be set to the corresponding path in the 'quarkusio/quarkus-ecosystem-ci' repository

env:
ECOSYSTEM_CI_REPO: quarkusio/quarkus-ecosystem-ci
Expand All @@ -15,35 +16,45 @@ env:
# Repo specific setting #
#########################

ECOSYSTEM_CI_REPO_PATH: quarkus-logging-json
ECOSYSTEM_CI_REPO_PATH: quarkiverse-logging-json

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash

jobs:
build:
name: "Build against latest Quarkus snapshot"
runs-on: ubuntu-latest
if: github.actor == 'quarkusbot' || github.actor == 'quarkiversebot'
# Allow <ADMIN> to manually launch the ecosystem CI in addition to the bots
if: github.actor == 'quarkusbot' || github.actor == 'quarkiversebot' || github.actor == '<ADMIN>'

steps:
- name: Install yq
run: sudo add-apt-repository ppa:rmescandon/yq && sudo apt update && sudo apt install yq -y
uses: dcarbone/install-yq-action@v1.0.1

- name: Set up Java
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: ${{ env.JAVA_VERSION }}

- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: current-repo

- name: Checkout Ecosystem
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: ${{ env.ECOSYSTEM_CI_REPO }}
path: ecosystem-ci

- name: Setup and Run Tests
run: ./ecosystem-ci/setup-and-test
env:
ECOSYSTEM_CI_TOKEN: ${{ secrets.ECOSYSTEM_CI_TOKEN }}
ECOSYSTEM_CI_TOKEN: ${{ secrets.ECOSYSTEM_CI_TOKEN }}
76 changes: 32 additions & 44 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,81 +6,69 @@ on:
paths:
- '.github/project.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash

jobs:
release:
runs-on: ubuntu-latest
name: release
if: ${{github.event.pull_request.merged == true}}

steps:
- uses: radcortez/project-metadata-action@master
- uses: radcortez/project-metadata-action@main
name: Retrieve project metadata
id: metadata
with:
github-token: ${{secrets.GITHUB_TOKEN}}
metadata-file-path: '.github/project.yml'

- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v3
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}

- uses: actions/setup-java@v1.4.3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11

- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
cache: 'maven'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD

- name: Configure Git author
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
- name: Maven release ${{steps.metadata.outputs.current-version}}
- name: Update latest release version in docs
run: |
gpg --quiet --batch --yes --decrypt --passphrase="${{secrets.GPG_PASSPHRASE}}" --output maven-settings.xml .github/release/maven-settings.xml.gpg
git checkout -b release
mvn -B release:prepare -Prelease -DreleaseVersion=${{steps.metadata.outputs.current-version}} -DdevelopmentVersion=${{steps.metadata.outputs.next-version}} -s maven-settings.xml
mvn -B -ntp -pl docs -am generate-resources -Denforcer.skip -Dformatter.skip -Dimpsort.skip
if ! git diff --quiet docs/modules/ROOT/pages/includes/attributes.adoc; then
git add docs/modules/ROOT/pages/includes/attributes.adoc
git commit -m "Update stable version for documentation"
git commit -m "Update the latest release version ${{steps.metadata.outputs.current-version}} in documentation"
fi
git checkout ${{github.base_ref}}
git rebase release
mvn -B release:perform -Darguments=-DperformRelease -Prelease -s maven-settings.xml
- name: Adjust tag for documentation changes
- name: Maven release ${{steps.metadata.outputs.current-version}}
run: |
git checkout ${{steps.metadata.outputs.current-version}}
mvn -B clean install -DskipTests -DskipITs
if ! git diff --quiet docs/modules/ROOT/pages/includes/attributes.adoc; then
git add docs/modules/ROOT/pages/includes/attributes.adoc
git commit -m "Update stable version for documentation"
# Move the tag after inclusion of documentation adjustments
git tag -f ${{steps.metadata.outputs.current-version}}
fi
# Go back to master
git checkout master
- name: Push changes to ${{github.base_ref}}
uses: ad-m/github-push-action@v0.6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{github.base_ref}}
mvn -B release:prepare -Prelease -DreleaseVersion=${{steps.metadata.outputs.current-version}} -DdevelopmentVersion=${{steps.metadata.outputs.next-version}}
mvn -B release:perform -Darguments=-DperformRelease -DperformRelease -Prelease
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}

- name: Push tags
uses: ad-m/github-push-action@v0.6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tags: true
branch: ${{github.base_ref}}
- name: Push changes to ${{github.base_ref}} branch
run: |
git push
git push origin ${{steps.metadata.outputs.current-version}}
2 changes: 1 addition & 1 deletion docs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<executions>
<execution>
<id>copy-resources</id>
<phase>prepare-package</phase>
<phase>generate-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
Expand Down

0 comments on commit bb073e9

Please sign in to comment.