Use custom versionManager #46
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
name: Publish common dev Artifacts to GitHub packages | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- 'main' | |
tags-ignore: | |
- '**' | |
permissions: | |
contents: write | |
packages: write | |
env: | |
ORG_GRADLE_PROJECT_HEDVIG_GITHUB_PACKAGES_USER: ${{ secrets.HEDVIG_GITHUB_PACKAGES_USER }} | |
ORG_GRADLE_PROJECT_HEDVIG_GITHUB_PACKAGES_TOKEN: ${{ secrets.HEDVIG_GITHUB_PACKAGES_TOKEN }} | |
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 | |
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 }}" |