-
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.
- Loading branch information
1 parent
e6ea2ed
commit 9330b99
Showing
1 changed file
with
112 additions
and
21 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 |
---|---|---|
|
@@ -18,21 +18,14 @@ env: | |
|
||
jobs: | ||
publish-spm: | ||
permissions: | ||
contents: write | ||
packages: write | ||
uses: touchlab/KMMBridgeGithubWorkflow/.github/workflows/[email protected] | ||
with: | ||
jvmVersion: 17 | ||
versionBaseProperty: LIBRARY_VERSION | ||
publish-maven: | ||
name: Release build and publish | ||
concurrency: "kmmbridgepublish-${{ github.repository }}" | ||
runs-on: macos-12 | ||
permissions: | ||
contents: write | ||
packages: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Checkout the repo with tags | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
fetch-tags: true | ||
- uses: actions/[email protected] | ||
with: | ||
java-version: 17 | ||
|
@@ -48,27 +41,125 @@ jobs: | |
uses: nanzm/[email protected] | ||
with: | ||
timeZone: 0 | ||
format: 'YYYY-MM-DD-HH-mm-ss' | ||
format: 'YYYYMMDDHHmmss' | ||
- uses: touchlab/read-property@main | ||
id: versionprop | ||
with: | ||
file: ./gradle.properties | ||
property: AUTHLIB_VERSION_NAME | ||
|
||
- name: Print tag to be generated and save into env | ||
env: | ||
ORG_GRADLE_PROJECT_AUTHLIB_VERSION_ALPHA_TIMESTAMP: "${{ steps.time.outputs.time }}" | ||
run: | | ||
echo "Timestamp: $ORG_GRADLE_PROJECT_AUTHLIB_VERSION_ALPHA_TIMESTAMP" | ||
- name: Generate SPM version | ||
id: generateSPMversion | ||
env: | ||
SPM_VERSION: "${{ steps.versionprop.outputs.propVal }}${{ steps.time.outputs.time }}" | ||
run: | | ||
spmWithoutAlpha=`echo "${{ steps.versionprop.outputs.propVal }}" | sed 's/-alpha//` | ||
echo "::set-output name=SPM_VERSION::$( | ||
${spmWithoutAlpha}${{ steps.time.outputs.time }} | ||
)" | ||
- name: Build | ||
id: gradle | ||
uses: gradle/[email protected] | ||
env: | ||
ORG_GRADLE_PROJECT_AUTHLIB_VERSION_ALPHA_TIMESTAMP: "${{ steps.time.outputs.time }}" | ||
|
||
# Maybe consider deleting old artifacts here | ||
# - name: Delete old SNAPSHOT | ||
# uses: actions/[email protected] | ||
- name: Print next SPM version | ||
run: | | ||
echo "${{ steps.generateSPMversion.outputs.SPM_VERSION }}" | ||
- uses: touchlab/autoversion-tagmarker@main | ||
id: autoversion-tagmarker | ||
with: | ||
nextVersion: ${{ steps.generateSPMversion.outputs.SPM_VERSION }} | ||
|
||
- uses: touchlab/autoversion-buildbranch@main | ||
id: autoversion-buildbranch | ||
with: | ||
buildBranch: "build-${{ steps.generateSPMversion.outputs.SPM_VERSION }}" | ||
|
||
# - uses: extractions/netrc@v1 | ||
# with: | ||
# package-name: | ||
# machine: ${{ inputs.netrcMachine }} | ||
# username: ${{ secrets.netrcUsername != '' && secrets.netrcUsername || 'cirunner' }} | ||
# password: ${{ secrets.netrcPassword != '' && secrets.netrcPassword || secrets.GITHUB_TOKEN }} | ||
|
||
- name: Publish to GitHub packages | ||
run: ./gradlew publishAllPublicationsToMavenRepository | ||
|
||
- name: Build Main | ||
run: ./gradlew kmmBridgePublish -PAUTO_VERSION=${{ steps.generateSPMversion.outputs.SPM_VERSION }} -PENABLE_PUBLISHING=true -PGITHUB_PUBLISH_TOKEN=${{ secrets.GITHUB_TOKEN }} -PGITHUB_REPO=${{ github.repository }} --no-daemon --stacktrace | ||
env: | ||
ORG_GRADLE_PROJECT_AUTHLIB_VERSION_ALPHA_TIMESTAMP: "${{ steps.time.outputs.time }}" | ||
GRADLE_OPTS: -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:MaxMetaspaceSize=512m" | ||
|
||
- uses: touchlab/autoversion-finishrelease@main | ||
id: autoversion-finishrelease | ||
with: | ||
commitMessage: "KMM SPM package release for ${{ steps.generateSPMversion.outputs.SPM_VERSION }}" | ||
tagMessage: "KMM release version ${{ steps.generateSPMversion.outputs.SPM_VERSION }}" | ||
tagVersion: ${{ steps.generateSPMversion.outputs.SPM_VERSION }} | ||
branchName: "build-${{ steps.generateSPMversion.outputs.SPM_VERSION }}" | ||
|
||
- uses: touchlab/autoversion-tagmarker@main | ||
id: autoversion-tagmarker-cleanup | ||
with: | ||
nextVersion: ${{ steps.generateSPMversion.outputs.SPM_VERSION }} | ||
cleanupMarkers: 'true' | ||
|
||
- name: Delete branch | ||
if: (!inputs.retainBuildBranch) && (!cancelled()) | ||
uses: touchlab/action-delete-branch@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branches: "build-${{ steps.generateSPMversion.outputs.SPM_VERSION }}" | ||
# publish-maven: | ||
# name: Release build and publish | ||
# runs-on: macos-12 | ||
# permissions: | ||
# contents: write | ||
# packages: write | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - uses: actions/[email protected] | ||
# with: | ||
# java-version: 17 | ||
# distribution: 'zulu' | ||
# - name: Setup Gradle | ||
# uses: gradle/gradle-build-action@v2 | ||
# with: | ||
# cache-read-only: false | ||
# gradle-home-cache-cleanup: true | ||
# | ||
# - name: Generate alpha version timestamp | ||
# id: time | ||
# uses: nanzm/[email protected] | ||
# with: | ||
# timeZone: 0 | ||
# format: 'YYYY-MM-DD-HH-mm-ss' | ||
# | ||
# - name: Print tag to be generated and save into env | ||
# env: | ||
# ORG_GRADLE_PROJECT_AUTHLIB_VERSION_ALPHA_TIMESTAMP: "${{ steps.time.outputs.time }}" | ||
# run: | | ||
# echo "Timestamp: $ORG_GRADLE_PROJECT_AUTHLIB_VERSION_ALPHA_TIMESTAMP" | ||
# | ||
# - name: Build | ||
# id: gradle | ||
# uses: gradle/[email protected] | ||
# env: | ||
# ORG_GRADLE_PROJECT_AUTHLIB_VERSION_ALPHA_TIMESTAMP: "${{ steps.time.outputs.time }}" | ||
# | ||
## Maybe consider deleting old artifacts here | ||
## - name: Delete old SNAPSHOT | ||
## uses: actions/[email protected] | ||
## with: | ||
## package-name: | ||
# | ||
# - name: Publish to GitHub packages | ||
# run: ./gradlew publishAllPublicationsToMavenRepository | ||
# env: | ||
# ORG_GRADLE_PROJECT_AUTHLIB_VERSION_ALPHA_TIMESTAMP: "${{ steps.time.outputs.time }}" |