Repository navigation
chore: 版本号 0.8.0 #20
Workflow file for this run
This file contains hidden or 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 | |
| on: | |
| push: | |
| tags: | |
| - '[0-9]+.[0-9]+.[0-9]+*' | |
| workflow_dispatch: # npm job --dry-run only: preview what a tag push would publish (no Maven, no release) | |
| jobs: | |
| maven: | |
| if: github.event_name == 'push' | |
| runs-on: macos-15 | |
| timeout-minutes: 60 | |
| permissions: | |
| contents: write # gh release create | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: 25 | |
| - uses: gradle/actions/setup-gradle@v5 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - name: quickjs-kmp host JNI for Android host tests (qjsc-kmp comes from the npm package) | |
| run: | | |
| version=$(sed -n 's/^quickjsKmp = "\(.*\)"/\1/p' gradle/libs.versions.toml) | |
| git clone --depth 1 --branch "$version" https://github.com/HarlonWang/quickjs-kmp.git "$RUNNER_TEMP/quickjs-kmp" | |
| (cd "$RUNNER_TEMP/quickjs-kmp" && ./gradlew :library:buildNativeHostJni --no-daemon) | |
| echo "TINYUI_QUICKJS_HOST_JNI=$RUNNER_TEMP/quickjs-kmp/library/build/native/host-jni/lib" >> "$GITHUB_ENV" | |
| - run: ./gradlew :compose:testAndroidHostTest :compose:apiCheck --no-daemon | |
| - name: Publish to Maven Central | |
| run: ./gradlew :compose:publishAndReleaseToMavenCentral :updates:publishAndReleaseToMavenCentral --no-configuration-cache --no-daemon | |
| env: | |
| ORG_GRADLE_PROJECT_VERSION_NAME: ${{ github.ref_name }} | |
| ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }} | |
| ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} | |
| ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_PRIVATE_KEY }} | |
| ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }} | |
| - run: gh release create "$GITHUB_REF_NAME" --generate-notes | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| # npm trusted publishing (OIDC): no token, provenance attached. Each package's Trusted Publisher | |
| # on npmjs.com is bound to this workflow's filename, so renaming publish.yml breaks it. | |
| npm: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: 24 # bundles npm >= 11.5.1, required for OIDC | |
| cache: pnpm | |
| - name: Tag must equal package versions | |
| if: github.event_name == 'push' | |
| run: | | |
| for pkg in core native cli; do | |
| v=$(node -p "require('./packages/$pkg/package.json').version") | |
| [ "$v" = "$GITHUB_REF_NAME" ] || { echo "packages/$pkg is $v, tag is $GITHUB_REF_NAME"; exit 1; } | |
| done | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm build | |
| - run: pnpm test | |
| - run: pnpm publish -r --access public --no-git-checks ${{ github.event_name == 'workflow_dispatch' && '--dry-run' || '' }} |