Skip to content

Commit

Permalink
Update deprecated workflow usage
Browse files Browse the repository at this point in the history
  • Loading branch information
ajalt committed Apr 28, 2024
1 parent a9e3ab5 commit 5e5ea68
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 30 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ jobs:
with:
distribution: 'zulu'
java-version: 21
- uses: gradle/gradle-build-action@v2
with:
arguments: |
- uses: gradle/actions/setup-gradle@v3
- name: Run tests
run: |
./gradlew
:mordant:check
:extensions:mordant-coroutines:check
:test:proguard:r8jar
Expand All @@ -52,7 +53,7 @@ jobs:
with:
name: error-report
path: build-reports.zip
publish:
publish-snapshot:
needs: test
runs-on: macos-latest
if: ${{ github.ref == 'refs/heads/master' && github.repository == 'ajalt/mordant' }}
Expand All @@ -62,11 +63,10 @@ jobs:
with:
distribution: 'zulu'
java-version: 21
- uses: gradle/actions/setup-gradle@v3
- name: Deploy to sonatype
uses: gradle/gradle-build-action@v2
with:
# disable configuration cache due to https://github.com/gradle/gradle/issues/22779
arguments: publishToMavenCentral -PsnapshotVersion=true --no-configuration-cache
# disable configuration cache due to https://github.com/gradle/gradle/issues/22779
run: ./gradlew publishToMavenCentral -PsnapshotVersion=true --no-configuration-cache
env:
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralPassword }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKey }}
Expand Down
45 changes: 24 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
jobs:
release:
runs-on: macos-latest
if: ${{ github.repository == 'ajalt/mordant' }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
Expand All @@ -17,32 +18,34 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: gradle/actions/setup-gradle@v3
- run: ./gradlew publishToMavenCentral --no-configuration-cache
env:
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralPassword }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_signingInMemoryKey }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralUsername }}
- name: Extract release notes
id: extract-release-notes
uses: ffurrer2/extract-release-notes@v2
- name: Create release
uses: ncipollo/release-action@v1
with:
body: ${{ steps.extract-release-notes.outputs.release_notes }}
- name: Dokka
uses: gradle/actions/setup-gradle@v3
with:
arguments: dokkaHtmlMultiModule
- run : ./prepare_docs.sh
- name: Build mkdocs
run: |
pip install mkdocs-material
mkdocs build
- name: Deploy docs to website
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: site
# Disabled due to https://github.com/ffurrer2/extract-release-notes/issues/339
# - name: Extract release notes
# id: extract-release-notes
# uses: ffurrer2/extract-release-notes@v2
# - name: Create release
# uses: ncipollo/release-action@v1
# with:
# body: ${{ steps.extract-release-notes.outputs.release_notes }}
# - name: Dokka
# uses: gradle/actions/setup-gradle@v3
# with:
# arguments: dokkaHtmlMultiModule
# - run : ./prepare_docs.sh
# - name: Build mkdocs
# run: |
# pip install mkdocs-material
# mkdocs build
# - name: Deploy docs to website
# uses: JamesIves/github-pages-deploy-action@v4
# with:
# branch: gh-pages
# folder: site
env:
# macos-latest is now macos-14 and has less than half as much memory available as other runners
GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx6g -Dfile.encoding=UTF-8" -Dorg.gradle.configureondemand=true -Dorg.gradle.parallel=false -Dkotlin.incremental=false -Dorg.gradle.project.kotlin.incremental.multiplatform=false -Dorg.gradle.project.kotlin.native.disableCompilerDaemon=true
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ plugins {
fun getPublishVersion(): String {
val version = project.property("VERSION_NAME").toString()
// Call gradle with -PsnapshotVersion to set the version as a snapshot.
// Otherwise, we skip it to save time.
if (!project.hasProperty("snapshotVersion")) return version
val buildNumber = System.getenv("GITHUB_RUN_NUMBER") ?: "0"
return "$version.$buildNumber-SNAPSHOT"
Expand Down

0 comments on commit 5e5ea68

Please sign in to comment.