Skip to content

Commit

Permalink
Update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
squid233 committed Apr 19, 2024
1 parent afa1c22 commit 72fec3c
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 17 deletions.
45 changes: 32 additions & 13 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,32 @@
name: Build and Publish
on: [ push, pull_request ]

on: [ push, workflow_dispatch ]

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
name: Test and Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5

# Setup Java 17 environment for the next steps
# Setup Java 21 environment for the next steps
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 17
java-version: 21
distribution: 'temurin'
- name: Grant execute permission for gradlew
if: ${{ runner.os != 'Windows' }}
Expand All @@ -20,13 +35,17 @@ jobs:
uses: gradle/actions/setup-gradle@v3
- name: Execute Gradle build
run: ./gradlew wasmJsBrowserDistribution

# If main branch update, deploy to gh-pages
- name: Deploy
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
uses: JamesIves/github-pages-deploy-action@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages # The branch the action should deploy to.
folder: composeApp/build/dist/wasmJs/productionExecutable # The folder the action should deploy.
clean: true # Automatically remove deleted files from the deploy branch
path: './composeApp/build/dist/wasmJs/productionExecutable'
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[versions]
compose = "1.6.1"
compose-plugin = "1.6.0-rc02"
compose = "1.6.4"
compose-plugin = "1.6.2"
junit = "4.13.2"
kotlin = "1.9.22"
kotlin = "1.9.23"

[libraries]
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down

0 comments on commit 72fec3c

Please sign in to comment.