Skip to content

Commit

Permalink
Updae actions
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebemish committed Dec 10, 2024
1 parent 4afbd81 commit 9bfeac2
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
{
"name": "Validate Gradle Wrapper",
"uses": "gradle/actions/wrapper-validation@v3"
"uses": "gradle/actions/wrapper-validation@v4"
},
{
"with": {
Expand All @@ -34,7 +34,7 @@
"gradle-home-cache-cleanup": true
},
"name": "Setup Gradle",
"uses": "gradle/actions/setup-gradle@v3"
"uses": "gradle/actions/setup-gradle@v4"
},
{
"name": "Build",
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/publish_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
},
{
"with": {
"script": "const pull_requests = ${{ toJSON(github.event.workflow_run.pull_requests) }};\nif (!pull_requests.length) {\n return core.error(\"This workflow doesn't match any pull requests!\");\n}\nlet allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({\n owner: context.repo.owner,\n repo: context.repo.repo,\n run_id: context.payload.workflow_run.id,\n});\nlet matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {\n return artifact.name == \"artifacts\"\n})[0];\nlet download = await github.rest.actions.downloadArtifact({\n owner: context.repo.owner,\n repo: context.repo.repo,\n artifact_id: matchArtifact.id,\n archive_format: 'zip',\n});\nlet fs = require('fs');\nfs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/repo.zip`, Buffer.from(download.data));"
"script": "const response = await github.rest.search.issuesAndPullRequests({\n q: 'repo:${{ github.repository }} is:pr sha:${{ github.event.workflow_run.head_sha }}',\n per_page: 1,\n})\nconst items = response.data.items\nif (items.length < 1) {\n console.error('No PRs found')\n return\n}\nconst pullRequestNumber = items[0].number\nlet allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({\n owner: context.repo.owner,\n repo: context.repo.repo,\n run_id: context.payload.workflow_run.id,\n});\nlet matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {\n return artifact.name == \"artifacts\"\n})[0];\nlet download = await github.rest.actions.downloadArtifact({\n owner: context.repo.owner,\n repo: context.repo.repo,\n artifact_id: matchArtifact.id,\n archive_format: 'zip',\n});\nlet fs = require('fs');\nfs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/repo.zip`, Buffer.from(download.data));\nreturn pullRequestNumber;"
},
"name": "Download Artifacts",
"uses": "actions/github-script@v7"
"uses": "actions/github-script@v7",
"id": "download_artifacts"
},
{
"name": "Unpack Artifacts",
Expand All @@ -33,7 +34,7 @@
"MAVEN_USER": "github",
"MAVEN_PASSWORD": "${{ secrets.PR_MAVEN_PASSWORD }}",
"MAVEN_URL": "https://maven.lukebemish.dev/pullrequests/",
"ALLOWED_VERSION": "*-pr${{ github.event.workflow_run.pull_requests[0].number }}",
"ALLOWED_VERSION": "*-pr${{ steps.download_artifacts.outputs.result }}",
"ALLOWED_PATHS": "dev/lukebemish/immaculate,dev/lukebemish/immaculate/*,dev/lukebemish/immaculate/wrapper/*"
}
}
Expand All @@ -45,11 +46,11 @@
"concurrency": "ci-${{ github.ref }}",
"on": {
"workflow_run": {
"types": [
"completed"
],
"workflows": [
"Build PR"
],
"types": [
"completed"
]
}
}
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
{
"name": "Validate Gradle Wrapper",
"uses": "gradle/actions/wrapper-validation@v3"
"uses": "gradle/actions/wrapper-validation@v4"
},
{
"with": {
Expand All @@ -38,7 +38,7 @@
"gradle-home-cache-cleanup": true
},
"name": "Setup Gradle",
"uses": "gradle/actions/setup-gradle@v3"
"uses": "gradle/actions/setup-gradle@v4"
},
{
"uses": "fregante/setup-git-user@v2"
Expand Down Expand Up @@ -83,7 +83,7 @@
},
{
"name": "Submit Dependencies",
"uses": "gradle/actions/dependency-submission@v3",
"uses": "gradle/actions/dependency-submission@v4",
"env": {
"BUILD_CACHE_PASSWORD": "${{ secrets.BUILD_CACHE_PASSWORD }}",
"BUILD_CACHE_USER": "${{ secrets.BUILD_CACHE_USER }}",
Expand Down Expand Up @@ -113,7 +113,7 @@
},
{
"name": "Validate Gradle Wrapper",
"uses": "gradle/actions/wrapper-validation@v3"
"uses": "gradle/actions/wrapper-validation@v4"
},
{
"with": {
Expand All @@ -130,7 +130,7 @@
"gradle-home-cache-cleanup": true
},
"name": "Setup Gradle",
"uses": "gradle/actions/setup-gradle@v3"
"uses": "gradle/actions/setup-gradle@v4"
},
{
"name": "Publish Central",
Expand Down Expand Up @@ -172,7 +172,7 @@
},
{
"name": "Validate Gradle Wrapper",
"uses": "gradle/actions/wrapper-validation@v3"
"uses": "gradle/actions/wrapper-validation@v4"
},
{
"with": {
Expand All @@ -189,7 +189,7 @@
"gradle-home-cache-cleanup": true
},
"name": "Setup Gradle",
"uses": "gradle/actions/setup-gradle@v3"
"uses": "gradle/actions/setup-gradle@v4"
},
{
"name": "Publish Plugins",
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
{
"name": "Validate Gradle Wrapper",
"uses": "gradle/actions/wrapper-validation@v3"
"uses": "gradle/actions/wrapper-validation@v4"
},
{
"with": {
Expand All @@ -33,7 +33,7 @@
"gradle-home-cache-cleanup": true
},
"name": "Setup Gradle",
"uses": "gradle/actions/setup-gradle@v3"
"uses": "gradle/actions/setup-gradle@v4"
},
{
"name": "Build",
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pluginManagement {
plugins {
id 'dev.lukebemish.conventions' version '0.1.10'
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0' apply false
id 'dev.lukebemish.managedversioning' version '1.2.19' apply false
id 'dev.lukebemish.managedversioning' version '1.2.26' apply false
}

gradle.lifecycle.beforeProject {
Expand Down

0 comments on commit 9bfeac2

Please sign in to comment.