-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI pipeline with build test and publish jobs (#1762)
* use ci-release plugin for automated publish and release * Fix conditional statement in ci.yml for publishing releases * temporarily run CI publish also for PRs * disable automated release note publishing * remove sonatype release command override * publish to sonatype central using temporary account * Update Publish.scala to use sonatypePublishToBundle for publishing * add sonatypeRepository * add sonatype s01 host config * publish using ci-release plugin * trigger pipeline on test branch * Update organization in Publish.scala * override default sonatype central deployment name * Refactor Publish.scala to update sonatypeCentralDeploymentName * update publish settings to fix publish path and sonatype profile name * update sonatypeProfileName to match sonatype account settings * adds pomExtra config * support publish to Azure * reorganize ci pipeline and add write permissions to ci job * upgrade release-drafter version * fix azure credentials script * add some debugging * fix multi-line credentials file * temporarily remove ci dependency in the pipeline * test azure credentials * remove cat line * enable all steps in ci pipeline * publish to sonatype only when manually triggered and for new tags * publish all modules of baker
- Loading branch information
Showing
12 changed files
with
181 additions
and
188 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,33 @@ | ||
name-template: 'v$RESOLVED_VERSION 🌈' | ||
tag-template: 'v$RESOLVED_VERSION' | ||
categories: | ||
- title: '🚀 Features' | ||
labels: | ||
- 'feature' | ||
- 'enhancement' | ||
- title: '🐛 Bug Fixes' | ||
labels: | ||
- 'fix' | ||
- 'bugfix' | ||
- 'bug' | ||
- title: '🧰 Maintenance' | ||
labels: | ||
- 'chore' | ||
- 'dependency' | ||
change-template: '- $TITLE @$AUTHOR (#$NUMBER)' | ||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. | ||
version-resolver: | ||
major: | ||
labels: | ||
- 'major' | ||
minor: | ||
labels: | ||
- 'minor' | ||
patch: | ||
labels: | ||
- 'patch' | ||
default: patch | ||
template: | | ||
## Changes | ||
$CHANGES |
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,129 @@ | ||
name: CI | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: ["master"] | ||
push: | ||
branches: ["master"] | ||
tags: ["v*"] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
ci: | ||
name: Build and test | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
cache: sbt | ||
- name: Run tests and coverage | ||
run: |- | ||
cp .jvmopts-ci .jvmopts | ||
sbt coverage test coverageReport && bash <(curl -s https://codecov.io/bash) | ||
- name: Prepare draft release notes | ||
continue-on-error: true | ||
uses: release-drafter/release-drafter@v6 | ||
with: | ||
config-name: release-drafter.yml | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
publish-sonatype: | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
name: Publish to Sonatype | ||
# Publish to Sonatype only on tags starting with 'v' and on workflow_dispatch | ||
if: | | ||
github.event_name == 'workflow_dispatch' || | ||
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) | ||
needs: [ci] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
cache: sbt | ||
- name: Publish to Sonatype | ||
run: sbt ci-release | ||
env: | ||
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} | ||
PGP_SECRET: ${{ secrets.PGP_SECRET }} | ||
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | ||
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | ||
publish-azure: | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
name: Publish to Azure | ||
needs: [ci] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
cache: sbt | ||
- name: Publish to Azure | ||
run: |- | ||
echo "Prepare credentials" | ||
CONTENTS=$(cat << EOF | ||
realm=pkgs.dev.azure.com | ||
host=pkgs.dev.azure.com | ||
user=$AZURE_FEEDUSER | ||
password=$AZURE_FEEDPASSWORD | ||
EOF | ||
) | ||
echo "$CONTENTS" > ~/.credentials | ||
sbt "clean; +aetherDeploy; project interaction-example-make-payment-and-ship-items; +aetherDeploy; project interaction-example-reserve-items; +aetherDeploy; project bakery-client-example; +aetherDeploy; project bakery-kafka-listener-example; +aetherDeploy" | ||
rm ~/.credentials | ||
env: | ||
AZURE_FEEDUSER: ${{ secrets.AZURE_FEEDUSER }} | ||
AZURE_FEEDPASSWORD: ${{ secrets.AZURE_FEEDPASSWORD }} | ||
AZURE_FEEDURL: ${{ secrets.AZURE_FEEDURL }} | ||
dependency-submission: | ||
name: Submit dependency graph | ||
continue-on-error: true | ||
needs: [ci] | ||
# run on 1) master branch | ||
# do not run on pull requests | ||
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
cache: sbt | ||
- name: Submit dependency graph | ||
uses: scalacenter/sbt-dependency-submission@v2 | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.