Skip to content

Commit f615d46

Browse files
committed
Add release ci workflow
1 parent c4b3bfc commit f615d46

File tree

4 files changed

+68
-53
lines changed

4 files changed

+68
-53
lines changed

.github/workflows/codeql.yml

Lines changed: 30 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ "main" ]
16+
branches: ["main"]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ "main" ]
19+
branches: ["main"]
2020
schedule:
21-
- cron: '43 14 * * 6'
21+
- cron: "43 14 * * 6"
2222

2323
jobs:
2424
analyze:
@@ -30,53 +30,35 @@ jobs:
3030
security-events: write
3131

3232
steps:
33-
- name: Checkout repository
34-
uses: actions/checkout@v3
33+
- name: Checkout repository
34+
uses: actions/checkout@v3
3535

36-
# Initializes the CodeQL tools for scanning.
37-
- name: Initialize CodeQL
38-
uses: github/codeql-action/init@v2
39-
with:
40-
languages: java
41-
# If you wish to specify custom queries, you can do so here or in a config file.
42-
# By default, queries listed here will override any specified in a config file.
43-
# Prefix the list here with "+" to use these queries and those in the config file.
36+
# Initializes the CodeQL tools for scanning.
37+
- name: Initialize CodeQL
38+
uses: github/codeql-action/init@v2
39+
with:
40+
languages: java
41+
# If you wish to specify custom queries, you can do so here or in a config file.
42+
# By default, queries listed here will override any specified in a config file.
43+
# Prefix the list here with "+" to use these queries and those in the config file.
4444

45-
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
46-
# queries: security-extended,security-and-quality
45+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
46+
# queries: security-extended,security-and-quality
4747

48-
- uses: actions/setup-java@v3
49-
with:
50-
java-version: '16'
51-
distribution: 'temurin'
52-
cache: gradle
53-
- name: Validate Gradle wrapper
54-
uses: gradle/wrapper-validation-action@v1.0.6
48+
- uses: actions/setup-java@v3
49+
with:
50+
java-version: "16"
51+
distribution: "temurin"
52+
cache: gradle
53+
- name: Validate Gradle wrapper
54+
uses: gradle/wrapper-validation-action@v1.0.6
5555

56-
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
57-
# If this step fails, then you should remove it and run the build manually (see below)
58-
- name: Autobuild
59-
uses: github/codeql-action/autobuild@v2
56+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
57+
# If this step fails, then you should remove it and run the build manually (see below)
58+
- name: Autobuild
59+
uses: github/codeql-action/autobuild@v2
6060

61-
# ℹ️ Command-line programs to run using the OS shell.
62-
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
63-
64-
# If the Autobuild fails above, remove it and uncomment the following three lines.
65-
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
66-
67-
# - uses: actions/setup-java@v3
68-
# with:
69-
# java-version: '16'
70-
# distribution: 'temurin'
71-
# cache: gradle
72-
# - name: Validate Gradle wrapper
73-
# uses: gradle/wrapper-validation-action@v1.0.6
74-
# - name: Build with Gradle
75-
# uses: gradle/gradle-build-action
76-
# with:
77-
# arguments: build
78-
79-
- name: Perform CodeQL Analysis
80-
uses: github/codeql-action/analyze@v2
81-
with:
82-
category: "/language:java"
61+
- name: Perform CodeQL Analysis
62+
uses: github/codeql-action/analyze@v2
63+
with:
64+
category: "/language:java"

.github/workflows/main.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
name: CI
22
on:
33
push:
4-
branches: [ main ]
4+
branches: [main]
55
jobs:
66
build:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
9+
- uses: actions/checkout@v3
1010
- uses: actions/setup-java@v3
1111
with:
12-
java-version: '16'
13-
distribution: 'temurin'
12+
java-version: "16"
13+
distribution: "temurin"
1414
cache: gradle
1515
- name: Validate Gradle wrapper
1616
uses: gradle/wrapper-validation-action@v1.0.6
17+
- name: Build with Gradle
18+
uses: gradle/gradle-build-action@v2.4.2
19+
with:
20+
arguments: build

.github/workflows/release.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
packages: write
13+
steps:
14+
- uses: actions/checkout@v3
15+
- name: Set up JDK 16
16+
uses: actions/setup-java@v3
17+
with:
18+
java-version: "16"
19+
distribution: "temurin"
20+
cache: gradle
21+
- name: Validate Gradle wrapper
22+
uses: gradle/wrapper-validation-action@v1.0.6
23+
- name: Publish to GitHub Packages
24+
uses: gradle/gradle-build-action@v2.4.2
25+
with:
26+
arguments: publish
27+
env:
28+
USERNAME: ${{ github.actor }}
29+
TOKEN: ${{ secrets.GITHUB_TOKEN }}

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ tasks.test {
4444

4545
publishing {
4646
publications {
47-
register<MavenPublication>("jpc") {
47+
register<MavenPublication>("gpr") {
4848
from(components["java"])
4949
}
5050
}

0 commit comments

Comments
 (0)