Skip to content

3.1.0

3.1.0 #12

Workflow file for this run

name: Publish
on:
workflow_dispatch:
release:
types: [ prereleased, released ]
permissions:
contents: write
jobs:
release:
name: Publish library
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}
- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
- name: setup-java
uses: actions/setup-java@v4
with:
java-version: 17
distribution: adopt
- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v2
- name: Deploy to Sonatype
run: |
NEW_VERSION=$(echo "${GITHUB_REF}" | cut -d "/" -f3)
echo "New version: ${NEW_VERSION}"
export ORG_GRADLE_PROJECT_VERSION_NAME=${NEW_VERSION}
echo "RELEASE_VERSION=$NEW_VERSION" >> "$GITHUB_ENV"
./gradlew publishAllPublicationsToMavenCentral --no-configuration-cache --stacktrace
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
- name: Update README for ${{ env.RELEASE_VERSION }}
run: ./.github/version.sh "${RELEASE_VERSION}"
- name: Commit changes to README to ${{ env.branch }}
uses: EndBug/add-and-commit@v9
with:
add: "./README.md"
message: "Update README.md with version ${{env.RELEASE_VERSION}}"
new_branch: main
documentation:
name: "Generate Documentation"
runs-on: ubuntu-latest
needs: release
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 17
distribution: adopt
- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v2
- name: Generate documentation
uses: gradle/gradle-build-action@v2
with:
arguments: dokkaHtmlMultiModule
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: dokka/
demo:
name: "Publish Demo"
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
needs: release
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 17
distribution: adopt
- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v2
- name: Build Production browser demo
uses: gradle/gradle-build-action@v2
with:
arguments: :demo:composeApp:jsBrowserProductionWebpack
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: kmpalette-demo
directory: demo/composeApp/build/dist/js/productionExecutable
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
branch: main