-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Revamped release workflow (#1349)"
This reverts commit 88eb204
- Loading branch information
Showing
10 changed files
with
348 additions
and
189 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,79 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
init_gpg() { | ||
gpg2 --fast-import --no-tty --batch --yes smallrye-sign.asc | ||
} | ||
|
||
init_git() { | ||
git config --global user.name "${GITHUB_ACTOR}" | ||
git config --global user.email "smallrye@googlegroups.com" | ||
} | ||
|
||
# -------- SCRIPT START HERE ----------------- | ||
|
||
init_git | ||
init_gpg | ||
|
||
export VERSION="" | ||
export BRANCH="HEAD" | ||
export EXTRA_PRE_ARGS="" | ||
|
||
if [[ ${DRY_RUN} == "true" ]]; then | ||
echo "[DRY RUN] - Dry Run Enabled - Git push will be skipped." | ||
fi | ||
|
||
if [[ ${MICRO_RELEASE} == "true" ]]; then | ||
EXTRA_PRE_ARGS="--micro" | ||
fi | ||
|
||
if [[ ! -z "${RELEASE_VERSION}" ]]; then | ||
EXTRA_PRE_ARGS="${EXTRA_PRE_ARGS} --release-version=${RELEASE_VERSION}" | ||
fi | ||
|
||
jbang .build/PreRelease.java --token="${GITHUB_TOKEN}" ${EXTRA_PRE_ARGS} | ||
|
||
export VERSION="" | ||
if [ -f /tmp/release-version ]; then | ||
VERSION=$(cat /tmp/release-version) | ||
else | ||
echo "'/tmp/release-version' expected after pre-release" | ||
exit 1 | ||
fi | ||
|
||
echo "Update website version to ${VERSION}" | ||
.build/UpdateDocsAttributesFiles.java --mutiny-version=${VERSION} | ||
if [[ $(git diff --stat) != '' ]]; then | ||
git add documentation/attributes.yaml | ||
git commit -m "Bumping the website version to ${VERSION}" | ||
git push | ||
echo "Version updated" | ||
else | ||
echo "The version was already correct" | ||
fi | ||
|
||
echo "Cutting release ${VERSION}" | ||
./mvnw -s .build/maven-ci-settings.xml -B -fn clean | ||
git checkout ${BRANCH} | ||
HASH=$(git rev-parse --verify $BRANCH) | ||
echo "Last commit is ${HASH} - creating detached branch" | ||
git checkout -b "r${VERSION}" "${HASH}" | ||
|
||
echo "Update version to ${VERSION}" | ||
./mvnw -B versions:set -DnewVersion="${VERSION}" -DgenerateBackupPoms=false -s maven-settings.xml | ||
./mvnw -B versions:set -DnewVersion="${VERSION}" -DgenerateBackupPoms=false -s maven-settings.xml -pl bom | ||
|
||
if [[ ${SKIP_TESTS} == "true" ]]; then | ||
./mvnw -B clean verify -Prelease -DskipTests -s maven-settings.xml | ||
else | ||
./mvnw -B clean verify -Prelease -s maven-settings.xml | ||
fi | ||
|
||
git commit -am "[RELEASE] - Bump version to ${VERSION}" | ||
git tag "${VERSION}" | ||
echo "Pushing tag to origin" | ||
if [[ ${DRY_RUN} == "true" ]]; then | ||
echo "[DRY RUN] - Skipping push: git push origin ${VERSION}" | ||
else | ||
git push origin "${VERSION}" | ||
fi |
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,22 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
init_gpg() { | ||
gpg2 --fast-import --no-tty --batch --yes smallrye-sign.asc | ||
} | ||
|
||
init_git() { | ||
git config --global user.name "${GITHUB_ACTOR}" | ||
git config --global user.email "smallrye@googlegroups.com" | ||
} | ||
|
||
# -------- SCRIPT START HERE ----------------- | ||
|
||
init_git | ||
init_gpg | ||
|
||
git fetch origin --tags | ||
git reset --hard | ||
git checkout "${REF}" | ||
./mvnw -B clean deploy -DskipTests -Prelease -s maven-settings.xml | ||
|
This file was deleted.
Oops, something went wrong.
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 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 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,39 @@ | ||
--- | ||
name: Deploy releases to Maven Central | ||
on: | ||
push: | ||
branches: | ||
- "!*" | ||
tags: | ||
- '[0-9]+.[0-9]+.[0-9]+*' | ||
|
||
jobs: | ||
perform-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.event.ref }} | ||
token: ${{ secrets.RELEASE_TOKEN }} | ||
- name: Install JDK 11 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: 11 | ||
distribution: temurin | ||
cache: maven | ||
- name: 'Deploy' | ||
env: | ||
GITHUB_CONTEXT: ${{ toJson(github) }} | ||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} | ||
REF: ${{ github.event.ref }} | ||
SECRET_FILES_PASSPHRASE: ${{ secrets.SECRET_FILES_PASSPHRASE }} | ||
run: | | ||
echo "Cutting release from ${REF}" | ||
sudo apt-get update -o Dir::Etc::sourcelist="sources.list" \ | ||
-o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" | ||
sudo apt-get install -y gnupg2 gnupg-agent | ||
sh .build/decrypt-secrets.sh | ||
sh .build/deploy-release.sh |
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,79 @@ | ||
--- | ||
name: Post release work | ||
on: | ||
push: | ||
branches: | ||
- "!*" | ||
tags: | ||
- '[0-9]+.[0-9]+.[0-9]+*' | ||
|
||
jobs: | ||
post-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.event.ref }} | ||
token: ${{ secrets.RELEASE_TOKEN }} | ||
- name: Install JDK 11 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: 11 | ||
distribution: temurin | ||
cache: maven | ||
- name: 'Run a quick local build' | ||
run: ./mvnw -s .build/maven-ci-settings.xml clean install -DskipTests | ||
- name: 'Collect Compatibility Justification' | ||
env: | ||
GITHUB_CONTEXT: ${{ toJson(github) }} | ||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} | ||
SECRET_FILES_PASSPHRASE: ${{ secrets.SECRET_FILES_PASSPHRASE }} | ||
run: | | ||
sudo apt-get update -o Dir::Etc::sourcelist="sources.list" \ | ||
-o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" | ||
sudo apt-get install -y gnupg2 gnupg-agent | ||
curl -s "https://get.sdkman.io" | bash | ||
source ~/.sdkman/bin/sdkman-init.sh && sdk install jbang | ||
mkdir -p target | ||
jbang .build/CompatibilityUtils.java extract | ||
- name: 'Post-Release Tasks' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} | ||
REF: ${{ github.event.ref }} | ||
run: | | ||
TAG=$(echo ${REF} | sed -e 's%refs/tags/%%g') | ||
source ~/.sdkman/bin/sdkman-init.sh && \ | ||
jbang .build/PostRelease.java --release-version=${TAG} --token=${GITHUB_TOKEN} | ||
- name: 'Clear compatibility justifications' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} | ||
REF: ${{ github.event.ref }} | ||
run: | | ||
source ~/.sdkman/bin/sdkman-init.sh | ||
git config --global user.name "${GITHUB_ACTOR}" | ||
git config --global user.email "smallrye@googlegroups.com" | ||
TAG=$(echo ${REF} | sed -e 's%refs/tags/%%g') | ||
echo "Waiting for artifacts to be available from Maven Central, otherwise the build will fail during the compatibility verification" | ||
echo "Version ${TAG}" | ||
ARTIFACTS=$(./mvnw -s .build/maven-ci-settings.xml -Dexec.executable='echo' -Dexec.args='${project.groupId}:${project.artifactId}' exec:exec -q | tr '\n' ',') | ||
echo "Artifacts: ${ARTIFACTS}" | ||
jbang .build/WaitForCentral.java \ | ||
--artifacts=$ARTIFACTS \ | ||
--expected-version="${TAG}" | ||
git clone -b main "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/smallrye/smallrye-mutiny.git" new-main | ||
cd new-main | ||
echo "Clearing difference justifications" | ||
jbang .build/CompatibilityUtils.java clear --version="${TAG}" --do-not-clear-version-prefix="1." | ||
if [[ $(git diff --stat) != '' ]]; then | ||
git add -A | ||
git status | ||
git commit -m "[POST-RELEASE] - Clearing breaking change justifications" | ||
git push origin main | ||
else | ||
echo "No justifications cleared" | ||
fi |
Oops, something went wrong.