Skip to content

Commit c07de5a

Browse files
committed
cicd: move all cicd code to Makefile
Move all code to the `Makefile`.
1 parent cf6a9ab commit c07de5a

File tree

5 files changed

+461
-206
lines changed

5 files changed

+461
-206
lines changed

.github/workflows/re-release.yml

Lines changed: 0 additions & 63 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 23 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515

1616
target-tag:
1717
type: string
18-
description: 'target-tag: tag or branch name to release. Use to to re-release failed releases'
18+
description: 'target-tag: tag or branch name to release. Use to re-release tagged releases'
1919
default: scylla-3.x
2020

2121
jobs:
@@ -33,12 +33,11 @@ jobs:
3333
- name: Checkout Repository
3434
uses: actions/checkout@v4
3535

36-
- name: Checkout Code One Commit Before ${{ inputs.target-tag }}
36+
- name: Checkout Code One Commit Before ${{ inputs.version_tag }}
3737
if: inputs.target-tag != 'scylla-3.x'
38-
run: |
39-
git fetch --prune --unshallow || true
40-
git checkout ${{ inputs.target-tag }}~1
41-
git tag -d ${{ inputs.target-tag }}
38+
env:
39+
RELEASE_TARGET_TAG: ${{ inputs.version_tag }}
40+
run: make checkout-one-commit-before
4241

4342
- name: Set up Java
4443
uses: actions/setup-java@v5
@@ -56,51 +55,37 @@ jobs:
5655
git config user.name "ScyllaDB Promoter"
5756
git config user.email "[email protected]"
5857
59-
- name: Clean project
60-
run: $MVNCMD clean
61-
62-
- name: Clean release
63-
run: $MVNCMD release:clean
64-
6558
- name: Prepare release
6659
env:
67-
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
60+
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
61+
RELEASE_SKIP_TESTS: ${{ inputs.skip-tests }}
6862
run: |
69-
if [[ "${{ inputs.skip-tests }}" == "true" ]]; then
70-
MAVEN_OPTS="${MAVEN_OPTS} -DskipTests=true -DskipITs=true"
71-
fi
72-
export MAVEN_OPTS
73-
$MVNCMD release:prepare -DpushChanges=false -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }}
63+
make release-prepare
7464
7565
- name: Perform release
66+
if: inputs.dry-run == false
7667
env:
77-
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
68+
RELEASE_SKIP_TESTS: ${{ inputs.skip-tests }}
69+
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
7870
SONATYPE_TOKEN_USERNAME: ${{ secrets.SONATYPE_TOKEN_USERNAME }}
7971
SONATYPE_TOKEN_PASSWORD: ${{ secrets.SONATYPE_TOKEN_PASSWORD }}
80-
run: |
81-
CMD_OPTS=""
82-
if [[ "${{ inputs.dry-run }}" != "true" ]]; then
83-
CMD_OPTS="-Drelease.autopublish=true"
84-
fi
85-
if [[ "${{ inputs.skip-tests }}" == "true" ]]; then
86-
MAVEN_OPTS="${MAVEN_OPTS} -DskipTests=true -DskipITs=true"
87-
fi
88-
export MAVEN_OPTS
89-
$MVNCMD release:perform $CMD_OPTS -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }} > >(tee /tmp/logs-stdout.log) 2> >(tee /tmp/logs-stderr.log)
72+
run: make release
9073

91-
- name: Upload stdout.log
92-
if: failure()
93-
uses: actions/upload-artifact@v4
94-
with:
95-
name: maven-stdout
96-
path: /tmp/logs-stdout.log
74+
- name: Perform release dry-run
75+
if: inputs.dry-run == true
76+
env:
77+
RELEASE_SKIP_TESTS: ${{ inputs.skip-tests }}
78+
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
79+
SONATYPE_TOKEN_USERNAME: ${{ secrets.SONATYPE_TOKEN_USERNAME }}
80+
SONATYPE_TOKEN_PASSWORD: ${{ secrets.SONATYPE_TOKEN_PASSWORD }}
81+
run: make release-dry-run
9782

98-
- name: Upload stderr.log
83+
- name: Upload release logs
9984
if: failure()
10085
uses: actions/upload-artifact@v4
10186
with:
102-
name: maven-stderr
103-
path: /tmp/logs-stderr.log
87+
name: maven-stdout
88+
path: /tmp/java-driver-release-logs/*.log
10489

10590
- name: Push changes to SCM
10691
if: ${{ inputs.dry-run == false && inputs.target-tag == 'scylla-3.x' }}

0 commit comments

Comments
 (0)