-
Notifications
You must be signed in to change notification settings - Fork 3
Add release workflows #71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| name: Create release notes | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| workflow_call: | ||
| secrets: | ||
| GH_PROJECT_ACCESS_TOKEN: | ||
| required: true | ||
|
|
||
| jobs: | ||
| create-release: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Set version | ||
| id: version | ||
| run: | | ||
| VERSION=$(echo ${{ github.ref }} | sed -e "s#refs/tags/v##g") | ||
| echo "version=${VERSION}" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Set up JDK 8 and 11 (default 8) | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: 'temurin' | ||
| java-version: | | ||
| 11 | ||
| 8 | ||
|
|
||
| - name: Checkout release note scripts | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: scalar-labs/actions | ||
| token: ${{ secrets.GH_PROJECT_ACCESS_TOKEN }} | ||
| path: ${{ github.workspace }} | ||
| sparse-checkout-cone-mode: false | ||
| sparse-checkout: | | ||
| release-note-script/src/main/java | ||
|
|
||
| - name: Move scripts to the working directory | ||
| run: cp ${{ github.workspace }}/release-note-script/src/main/java/* ${{ github.workspace }} | ||
|
|
||
| - name: Create release note body | ||
| id: rn_body | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GH_PROJECT_ACCESS_TOKEN }} | ||
| run: | | ||
| $JAVA_HOME_11_X64/bin/java ReleaseNoteCreation.java ${{ github.repository_owner }} ScalarDL ${{ steps.version.outputs.version }} ${{ github.event.repository.name }} > rnbody.md | ||
| cat rnbody.md | ||
|
|
||
| - name: Create release | ||
| id: create_release | ||
| uses: actions/create-release@v1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GH_PROJECT_ACCESS_TOKEN }} | ||
| with: | ||
| tag_name: ${{ github.ref }} | ||
| release_name: ${{ github.ref }} | ||
| body_path: rnbody.md | ||
| draft: true | ||
| prerelease: false | ||
|
|
||
| - name: Checkout the current repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Gradle | ||
| uses: gradle/actions/setup-gradle@v4 | ||
|
|
||
| - name: Build client SDK zip | ||
| run: ./gradlew :client:distZip | ||
|
|
||
| - name: Upload client SDK zip | ||
| uses: actions/upload-release-asset@v1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GH_PROJECT_ACCESS_TOKEN }} | ||
| with: | ||
| upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
| asset_path: client/build/distributions/scalardl-java-client-sdk-${{ steps.version.outputs.version }}.zip | ||
| asset_name: scalardl-java-client-sdk-${{ steps.version.outputs.version }}.zip | ||
| asset_content_type: application/zip | ||
|
|
||
| - name: Build zip for generic contracts and functions | ||
| run: ./gradlew :generic-contracts:distZip | ||
|
|
||
| - name: Upload zip for generic contracts and functions | ||
| uses: actions/upload-release-asset@v1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GH_PROJECT_ACCESS_TOKEN }} | ||
| with: | ||
| upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
| asset_path: generic-contracts/build/distributions/scalardl-generic-contracts-${{ steps.version.outputs.version }}.zip | ||
| asset_name: scalardl-generic-contracts-${{ steps.version.outputs.version }}.zip | ||
| asset_content_type: application/zip |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| name: Release SNAPSHOT | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| - "[0-9]+" | ||
| - "[0-9]+.[0-9]+" | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| release: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up JDK 1.8 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: 'temurin' | ||
| java-version: '8' | ||
|
|
||
| - name: Setup Gradle | ||
| uses: gradle/actions/setup-gradle@v4 | ||
|
|
||
| - name: Set version | ||
| id: version | ||
| run: | | ||
| VERSION=$(./gradlew :ledger:properties -q | grep "version:" | awk '{print $2}') | ||
| echo "version=${VERSION}" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Upload the SNAPSHOT versions of scalardl-ledger, scalardl-java-client-sdk, scalardl-common, and scalardl-rpc to Maven Central Repository | ||
| if: contains(steps.version.outputs.version, '-SNAPSHOT') | ||
| run: | | ||
| echo "${{secrets.SIGNING_SECRET_KEY_RING}}" | base64 -d > /tmp/secring.gpg | ||
| ./gradlew publish \ | ||
| -Psigning.keyId="${{ secrets.SIGNING_KEY_ID }}" \ | ||
| -P'signing.password'="${{ secrets.SIGNING_PASSWORD }}" \ | ||
| -Psigning.secretKeyRingFile="$(echo /tmp/secring.gpg)" \ | ||
| -PossrhUsername="${{ secrets.OSSRH_USERNAMAE }}" \ | ||
| -PossrhPassword="${{ secrets.OSSRH_PASSWORD }}" | ||
|
|
||
| - name: Create SNAPSHOT container images | ||
| if: contains(steps.version.outputs.version, '-SNAPSHOT') | ||
| run: ./gradlew docker | ||
|
|
||
| - name: Push SNAPSHOT container images | ||
| if: contains(steps.version.outputs.version, '-SNAPSHOT') | ||
| run: | | ||
| docker push ghcr.io/scalar-labs/scalardl-ledger:${{ steps.version.outputs.version }} | ||
| docker push ghcr.io/scalar-labs/scalardl-client:${{ steps.version.outputs.version }} | ||
|
Comment on lines
+51
to
+52
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We will release Docker images of the community edition with the new name "scalardl-xx" while keeping the old ones until we can confirm they are no longer referred. BTW, do we really need to release the client image? Let me know your opinion or use cases if you know.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
At least, I think we are using However, the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, sorry. I misunderstood. It's a SNAPSHOT image. I think we don't use the If it includes ScalarDL CLI, some users or developers might want to use it for the testing of the |
||
| docker push ghcr.io/scalar-labs/scalardl-schema-loader:${{ steps.version.outputs.version }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - "v[0-9]+.[0-9]+.[0-9]+" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| id-token: write | ||
| contents: read | ||
|
|
||
| jobs: | ||
| upload-artifacts: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Set version | ||
| id: version | ||
| run: | | ||
| VERSION=$(echo ${{ github.ref }} | sed -e "s#refs/tags/v##g") | ||
| echo "version=${VERSION}" >> $GITHUB_OUTPUT | ||
|
|
||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up JDK 1.8 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: 'temurin' | ||
| java-version: '8' | ||
|
|
||
| - name: Setup Gradle | ||
| uses: gradle/actions/setup-gradle@v4 | ||
|
|
||
| - name: Upload scalardl-ledger, scalardl-java-client-sdk, scalardl-common, and scalardl-rpc to Maven Central Repository | ||
| run: | | ||
| echo "${{secrets.SIGNING_SECRET_KEY_RING}}" | base64 -d > /tmp/secring.gpg | ||
| ./gradlew publish \ | ||
| -Pversion=${{ steps.version.outputs.version }} \ | ||
| -Psigning.keyId="${{ secrets.SIGNING_KEY_ID }}" \ | ||
| -P'signing.password'="${{ secrets.SIGNING_PASSWORD }}" \ | ||
| -Psigning.secretKeyRingFile="$(echo /tmp/secring.gpg)" \ | ||
| -PossrhUsername="${{ secrets.OSSRH_USERNAMAE }}" \ | ||
| -PossrhPassword="${{ secrets.OSSRH_PASSWORD }}" | ||
|
|
||
| - name: Login to GitHub Container Registry | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.repository_owner }} | ||
| password: ${{ secrets.CR_PAT }} | ||
|
|
||
| - name: Create containers | ||
| run: ./gradlew docker | ||
|
|
||
| - name: Push containers to private GitHub Packages | ||
| run: | | ||
| docker push ghcr.io/scalar-labs/scalardl-ledger:${{ steps.version.outputs.version }} | ||
| docker push ghcr.io/scalar-labs/scalardl-client:${{ steps.version.outputs.version }} | ||
| docker push ghcr.io/scalar-labs/scalardl-schema-loader:${{ steps.version.outputs.version }} | ||
|
|
||
| create-release-notes: | ||
| needs: upload-artifacts | ||
| if: ${{ success() }} | ||
| uses: ./.github/workflows/create-release-notes.yaml | ||
| secrets: | ||
| GH_PROJECT_ACCESS_TOKEN: ${{ secrets.GH_PROJECT_ACCESS_TOKEN }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| apply plugin: 'maven-publish' | ||
| apply plugin: 'signing' | ||
|
|
||
| publishing { | ||
| publications { | ||
| mavenJava(MavenPublication) { | ||
| artifactId = 'scalardl-ledger' | ||
|
Comment on lines
+6
to
+7
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @feeblefakie Not sure, but do we need to do something to release a new artifact in Maven?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think so, but we'll see... |
||
| from components.java | ||
| artifact javadocJar | ||
| artifact sourcesJar | ||
| pom { | ||
| name = 'ScalarDL Ledger' | ||
| description = 'Ledger component of ScalarDL, scalable and practical Byzantine fault detection middleware for transactional database systems.' | ||
| url = 'https://github.com/scalar-labs/scalardl' | ||
| licenses { | ||
| license { | ||
| name = 'Apache License, Version 2.0' | ||
| url = 'http://www.apache.org/licenses/LICENSE-2.0' | ||
| } | ||
| } | ||
| developers { | ||
| developer { | ||
| id = 'hiroyuki' | ||
| name = 'Hiroyuki Yamada' | ||
| email = 'hiroyuki.yamada@scalar-labs.com' | ||
| } | ||
| developer { | ||
| id = 'jnmt' | ||
| name = 'Jun Nemoto' | ||
| email = 'jun.nemoto@scalar-labs.com' | ||
| } | ||
| } | ||
| scm { | ||
| connection = 'scm:git:https://github.com/scalar-labs/scalardl.git' | ||
| developerConnection = 'scm:git:https://github.com/scalar-labs/scalardl.git' | ||
| url = 'https://github.com/scalar-labs/scalardl' | ||
| } | ||
| } | ||
| } | ||
| } | ||
| repositories { | ||
| maven { | ||
| def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2" | ||
| def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots" | ||
| url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl | ||
| credentials { | ||
| username = "${ossrhUsername}" | ||
| password = "${ossrhPassword}" | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| signing { | ||
| sign publishing.publications.mavenJava | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will release SNAPSHOT versions of release and support branches to properly refer them from each release and support branches from the
scalarrepository.