-
Notifications
You must be signed in to change notification settings - Fork 0
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 #2 from conduktor/fix-release-ci
Split release workflow and fix publish part and add general test workflow CI
- Loading branch information
Showing
3 changed files
with
72 additions
and
36 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,25 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: [ opened, reopened, synchronize ] | ||
|
||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '21' | ||
distribution: 'temurin' | ||
|
||
- name: Test | ||
run: mvn test |
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,45 @@ | ||
name: Publish release | ||
run-name: Publish release ${GITHUB_REF#refs/*/} on ${{ github.sha }} by @${{ github.actor }} | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
publish-release: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Get the Github Release version | ||
run: | | ||
ref=${GITHUB_REF#refs/*/} | ||
git show-ref --verify refs/tags/${ref} || { echo "Ref ${GITHUB_REF} is not a tag" ; exit 1; } | ||
echo "RELEASE_VERSION=${ref}" >> "$GITHUB_ENV" | ||
- name: Checkout tag ${{ env.RELEASE_VERSION }} | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ env.RELEASE_VERSION }} | ||
|
||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '21' | ||
distribution: 'temurin' | ||
|
||
- name: Deploy | ||
run: mvn -DskipTests --batch-mode deploy | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Create Github Release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
name: "${{ env.RELEASE_VERSION }}" | ||
tag: ${{ env.RELEASE_VERSION }} | ||
artifacts: "target/azure-kafka-oauthbearer-*.jar" | ||
token: ${{ secrets.GITHUB_TOKEN }} |