Skip to content

Commit 756daa2

Browse files
committed
feat: update actions and pin action version by pinact
1 parent 2fc5db3 commit 756daa2

File tree

4 files changed

+78
-30
lines changed

4 files changed

+78
-30
lines changed

.github/workflows/build.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,24 @@ jobs:
1818
permissions:
1919
contents: read
2020
steps:
21-
- uses: actions/checkout@v3
22-
- uses: actions/setup-java@v3
21+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
22+
- uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
2323
with:
2424
java-version: "8"
25-
distribution: "adopt"
26-
cache: "maven"
25+
distribution: "temurin"
26+
2727
- run: java -version
28-
- run: mvn --version
29-
- run: mvn -B package
28+
29+
- name: Setup Gradle
30+
uses: gradle/actions/setup-gradle@8379f6a1328ee0e06e2bb424dadb7b159856a326 # v4.4.0
31+
with:
32+
validate-wrappers: true
33+
34+
- name: Build with Gradle
35+
run: ./gradlew build
36+
37+
- name: Upload artifacts
38+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
39+
with:
40+
name: artifacts
41+
path: build/libs/*.jar

.github/workflows/deploy.yml

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,30 @@ name: Deploy
33
on:
44
workflow_dispatch:
55
push:
6-
branches:
7-
- main
8-
paths-ignore:
9-
- "**.md"
10-
- "renovate.json"
6+
tag:
7+
- "*"
118

129
jobs:
1310
build:
1411
runs-on: ubuntu-latest
1512
permissions:
1613
contents: read
1714
steps:
18-
- uses: actions/checkout@v3
19-
- name: Set up JDK 8
20-
uses: actions/setup-java@v3
15+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
16+
- uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
2117
with:
22-
java-version: '8'
23-
distribution: 'adopt'
24-
server-id: azisaba
25-
- name: Build with Maven
26-
run: mvn -B package --file pom.xml
27-
- name: Prepare settings.xml
28-
run: |
29-
echo "<settings><servers><server><id>azisaba</id><username>${{ secrets.REPO_USERNAME }}</username><password>${{ secrets.REPO_PASSWORD }}</password></server></servers></settings>" > $HOME/.m2/settings.xml
30-
- name: Deploy
31-
run: mvn deploy
18+
java-version: "8"
19+
distribution: "temurin"
20+
21+
- run: java -version
22+
23+
- name: Setup Gradle
24+
uses: gradle/actions/setup-gradle@8379f6a1328ee0e06e2bb424dadb7b159856a326 # v4.4.0
25+
with:
26+
validate-wrappers: true
27+
28+
- name: Publish to azisaba repo
29+
run: ./gradlew publish
30+
env:
31+
REPO_USERNAME: ${{ secrets.REPO_USERNAME }}
32+
REPO_PASSWORD: ${{ secrets.REPO_PASSWORD }}

.pinact.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/suzuki-shunsuke/pinact/refs/heads/main/json-schema/pinact.json
2+
# pinact - https://github.com/suzuki-shunsuke/pinact
3+
version: 3
4+
# files:
5+
# - pattern: action.yaml
6+
# - pattern: */action.yaml
7+
8+
ignore_actions:
9+
# - name: slsa-framework/slsa-github-generator/\.github/workflows/generator_generic_slsa3\.yml
10+
# ref: v\d+\.\d+\.\d+
11+
# - name: actions/.*
12+
# ref: main
13+
# - name: suzuki-shunsuke/.*
14+
# ref: release-.*

build.gradle.kts

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,6 @@ dependencies {
3333
compileOnly(libs.lunachatplus)
3434
}
3535

36-
publishing {
37-
publications.create<MavenPublication>("maven") {
38-
from(components["java"])
39-
}
40-
}
41-
4236
tasks.withType<JavaCompile> {
4337
options.encoding = "UTF-8"
4438
}
@@ -75,3 +69,30 @@ tasks.shadowJar {
7569
lombok {
7670
version = "1.18.38"
7771
}
72+
73+
publishing {
74+
publications {
75+
create<MavenPublication>("maven") {
76+
groupId = project.group.toString()
77+
artifactId = project.name
78+
version = project.version.toString()
79+
artifact(tasks.jar)
80+
}
81+
}
82+
83+
repositories {
84+
maven {
85+
name = "azisaba-repo"
86+
credentials {
87+
username = System.getenv("REPO_USERNAME")
88+
password = System.getenv("REPO_PASSWORD")
89+
}
90+
url =
91+
if (project.version.toString().endsWith("-SNAPSHOT")) {
92+
uri("https://repo.azisaba.net/repository/maven-snapshots/")
93+
} else {
94+
uri("https://repo.azisaba.net/repository/maven-releases/")
95+
}
96+
}
97+
}
98+
}

0 commit comments

Comments
 (0)