Skip to content

Commit

Permalink
Update workflow to avoid deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
emilymclean committed Nov 17, 2024
1 parent 887da24 commit 7b4c274
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 51 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.pkl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
amends "pkl/build.pkl"
import "pkl/src/common.pkl" as common
amends "package://components.emilym.cl/actions-java/actions-java@1.0.2#/build.pkl"
import "package://components.emilym.cl/actions-java/actions-java@1.0.2#/common/common.pkl" as common

projectName = "jlemmy"

local b = (import("pkl/build.pkl")) {
local b = (import("package://components.emilym.cl/actions-java/actions-java@1.0.2#/build.pkl")) {
projectName = "jlemmy"
}

Expand Down Expand Up @@ -49,7 +49,7 @@ jobs = (b.jobs) {
}
steps = new Listing {
common.checkout
common.create_release
...common.create_release
}
}
}
53 changes: 25 additions & 28 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
Expand All @@ -38,23 +38,21 @@ jobs:
- version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: temurin
- name: Setup gradle
uses: gradle/actions/setup-gradle@v3
- name: Build with Gradle
env:
ORG_GRADLE_PROJECT_version: ${{ needs.version.outputs.version }}
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
with:
arguments: build
run: ./gradlew build
- name: Rename AAR
run: mv ./build/libs/jlemmy-${{ needs.version.outputs.version }}.jar ./jlemmy.jar
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v4
with:
name: jlemmy-jar
path: ./jlemmy.jar
Expand All @@ -68,9 +66,13 @@ jobs:
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create tag for release
uses: rickstaa/action-create-tag@v1
with:
tag: v${{ needs.version.outputs.version }}
- id: create_release
name: Create Release
uses: softprops/action-gh-release@v2
Expand All @@ -87,14 +89,14 @@ jobs:
- build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@master
- uses: actions/download-artifact@v4
with:
name: jlemmy-jar
path: ./
- name: Upload Artifact to Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: actions/upload-release-asset@v1
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./jlemmy.jar
Expand All @@ -108,26 +110,21 @@ jobs:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: temurin
- name: Setup gradle
uses: gradle/actions/setup-gradle@v3
- name: Build with Gradle
env:
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.PGP_SECRET }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.PGP_PASSPHRASE }}
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
with:
arguments: |-
-Pversion=${{ needs.version.outputs.version }}
-Ppom.url="https://github.com/${{ github.repository }}"
-Ppom.scm.connection="scm:git:git://github.com/${{ github.repository }}"
-Ppom.scm.developerConnection="scm:git:ssh://github.com/${{ github.repository }}"
-Ppom.scm.url="https://github.com/${{ github.repository }}"
publishToCentralPortal --no-daemon
run: |-
./gradlew -Pversion=${{ needs.version.outputs.version }}
-Ppom.url="https://github.com/${{ github.repository }}"
-Ppom.scm.connection="scm:git:git://github.com/${{ github.repository }}"
-Ppom.scm.developerConnection="scm:git:ssh://github.com/${{ github.repository }}"
-Ppom.scm.url="https://github.com/${{ github.repository }}"
publishToCentralPortal --no-daemon
1 change: 0 additions & 1 deletion .github/workflows/pkl
Submodule pkl deleted from 0ecef0
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: temurin
- name: Setup gradle
uses: gradle/actions/setup-gradle@v3
- name: Test with Gradle
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
with:
arguments: test
run: ./gradlew test
8 changes: 4 additions & 4 deletions .github/workflows/update-types.pkl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
extends "pkl/src/base.pkl"
import "pkl/src/common.pkl"
extends "package://components.emilym.cl/actions-java/actions-java@1.0.2#/common/base.pkl"
import "package://components.emilym.cl/actions-java/actions-java@1.0.2#/common/common.pkl"

name = "Update"

Expand Down Expand Up @@ -38,7 +38,7 @@ jobs = new Mapping {
}
new ActionStep {
name = "Setup python"
uses = "actions/setup-python@v3"
uses = "actions/setup-python@v5"
with = new Mapping {
["python-version"] = "3.11"
}
Expand All @@ -62,7 +62,7 @@ jobs = new Mapping {
}
new ActionStep {
name = "Create pull request"
uses = "peter-evans/create-pull-request@v6"
uses = "peter-evans/create-pull-request@v7"
with = new Mapping {
["branch"] = "update-types/feature/update-types-${{ steps.date.outputs.date }}"
["title"] = "Update types from source"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
Expand All @@ -21,7 +21,7 @@ jobs:
git pull --recurse-submodules
git submodule update --remote --recursive type-generator/lemmy-js-client
- name: Setup python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
Expand All @@ -32,7 +32,7 @@ jobs:
name: Get current date
run: echo "::set-output name=date::$(date +'%Y%m%d-%s')"
- name: Create pull request
uses: peter-evans/create-pull-request@v6
uses: peter-evans/create-pull-request@v7
with:
branch: update-types/feature/update-types-${{ steps.date.outputs.date }}
title: Update types from source
4 changes: 2 additions & 2 deletions .github/workflows/workflows.pkl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
amends "pkl/render.pkl"
amends "package://components.emilym.cl/actions-java/actions-java@1.0.2#/render.pkl"

workflows = new Listing {
import("build.pkl")
import("pkl/test.pkl")
import("package://components.emilym.cl/actions-java/actions-java@1.0.2#/test.pkl")
import("update-types.pkl")
}
5 changes: 1 addition & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "type-generator/lemmy-js-client"]
path = type-generator/lemmy-js-client
url = https://github.com/LemmyNet/lemmy-js-client.git
[submodule ".github/workflows/pkl"]
path = .github/workflows/pkl
url = git@github.com:ComposeComponents/actions-java.git
url = https://github.com/LemmyNet/lemmy-js-client.git

0 comments on commit 7b4c274

Please sign in to comment.