-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(ci): add automated release management (#962)
This removes the need to run ./local-dev/bump.sh to prepare for new version releases. By default 0.0.0-development or just 0.0.0 is statically present in some files but it's replaced by the corresponding version during the workflow run. The release workflow will be triggered on any commit tagged with prefix v and the semantic version like v0.0.0-development. The pipeline process generates: docker images with the matching semantic version lh-server:0.0.0-development lh-dashboard:0.0.0-development etc SDKs with semantic version sdk-java sdk-python sdk-js sdk-go module with git tag lhctl version lh-server ServerVersionResponse{majorVersion, minorVersion, patchVersion, preReleaseIdentifier}
- Loading branch information
Showing
14 changed files
with
143 additions
and
130 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -3,37 +3,59 @@ run-name: Release ${{ github.ref_name }} | |
on: | ||
push: | ||
tags: | ||
- "[0-9]+.[0-9]+.[0-9]+*" # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet | ||
- "v[0-9]+.[0-9]+.[0-9]+*" | ||
|
||
permissions: | ||
packages: write | ||
contents: write | ||
jobs: | ||
prepare: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
tag: ${{ steps.set_tag.outputs.tag }} | ||
steps: | ||
- name: Set Tag | ||
id: set_tag | ||
run: | | ||
echo "tag=$(echo $GITHUB_REF | sed -n 's/refs\/tags\/v//p')" >> $GITHUB_OUTPUT | ||
publish-docker: | ||
uses: ./.github/workflows/publish-docker.yml | ||
|
||
sdk-java: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- publish-docker | ||
- prepare | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: "corretto" | ||
java-version: "11" | ||
|
||
- name: Dump version | ||
env: | ||
TAG: ${{ needs.prepare.outputs.tag }} | ||
run: sed -i "s/version=.*/version=${TAG}/g" gradle.properties | ||
|
||
- name: Tests | ||
run: ./gradlew sdk-java:test | ||
|
||
- name: Import GPG key | ||
uses: crazy-max/ghaction-import-gpg@v5 | ||
with: | ||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
passphrase: ${{ secrets.GPG_PASSPHRASE }} | ||
|
||
- name: Generate KeyRing | ||
run: | | ||
gpg --keyring secring.gpg --export-secret-keys --passphrase ${{ secrets.GPG_PASSPHRASE }} --batch --yes --pinentry-mode=loopback > ~/.gnupg/secring.gpg | ||
ls ~/.gnupg/ | ||
- name: Publish | ||
run: | | ||
./gradlew sdk-java:publish -Psigning.secretKeyRingFile=/home/runner/.gnupg/secring.gpg -Psigning.password=${{ secrets.GPG_PASSPHRASE }} -Psigning.keyId=${{ vars.GPG_KEY_ID }} -PossrhUsername=${{ secrets.OSSRH_USERNAME }} -PossrhPassword=${{ secrets.OSSRH_PASSWORD }} | ||
|
@@ -43,23 +65,33 @@ jobs: | |
runs-on: ubuntu-latest | ||
needs: | ||
- publish-docker | ||
- prepare | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Dump version | ||
env: | ||
TAG: ${{ needs.prepare.outputs.tag }} | ||
run: sed -i "s/version = '.*'/version = '${TAG}'/g" sdk-python/pyproject.toml | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.9" | ||
|
||
- name: Install Dependencies | ||
run: | | ||
python -m pip install --upgrade pip setuptools wheel | ||
pip install poetry | ||
- name: Tests | ||
working-directory: ./sdk-python | ||
run: | | ||
poetry install | ||
poetry run python -m unittest -v | ||
poetry build | ||
- name: Publish Package | ||
uses: pypa/[email protected] | ||
with: | ||
|
@@ -71,6 +103,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
needs: | ||
- publish-docker | ||
- prepare | ||
env: | ||
working-directory: ./sdk-js | ||
steps: | ||
|
@@ -96,7 +129,7 @@ jobs: | |
- name: Use tag | ||
working-directory: ${{env.working-directory}} | ||
env: | ||
TAG: ${{ github.ref_name }} | ||
TAG: ${{ needs.prepare.outputs.tag }} | ||
run: cat package.json | jq -r ".version = \"${TAG}\"" | tee package.json | ||
|
||
- name: Build | ||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
version=0.10.1 | ||
version=0.0.0-development | ||
group=io.littlehorse | ||
kafkaVersion=3.8.0 | ||
lombokVersion=1.18.28 | ||
|
Oops, something went wrong.