Skip to content

Commit dc5c971

Browse files
committed
[GitHub Actions] Auto Release
1 parent e194eb7 commit dc5c971

File tree

2 files changed

+43
-3
lines changed

2 files changed

+43
-3
lines changed

.github/workflows/build.yml

+19-2
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,32 @@ on: [push]
55
jobs:
66
build:
77
runs-on: ubuntu-latest
8+
strategy:
9+
fail-fast: true
810
steps:
11+
# Get the latest commit ID
12+
- id: commit
13+
uses: pr-mpt/actions-commit-hash@v1
14+
# Clone the repo & its submodules
915
- uses: actions/checkout@v3
1016
with:
1117
submodules: recursive
18+
# Setup Java & Maven
1219
- name: Install Java 8
1320
uses: actions/setup-java@v3
1421
with:
1522
java-version: '8'
1623
distribution: 'adopt'
1724
architecture: x64
18-
- name: build
19-
run: ./compile
25+
# Compile the project
26+
- name: Compile the NetHandler
27+
run: cd NetHandler && mvn clean install
28+
- name: Compile the API
29+
run: mvn clean install
30+
# Create a release with the compiled API jar
31+
- uses: ncipollo/release-action@v1
32+
with:
33+
prerelease: true
34+
artifacts: "target/CheatBreakerAPI.jar"
35+
tag: ${{ steps.commit.outputs.short }}
36+
token: ${{ secrets.GITHUB_TOKEN }}

pom.xml

+24-1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,29 @@
6565
</execution>
6666
</executions>
6767
</plugin>
68+
<plugin>
69+
<groupId>io.github.git-commit-id</groupId>
70+
<artifactId>git-commit-id-maven-plugin</artifactId>
71+
<version>4.9.9</version>
72+
<executions>
73+
<execution>
74+
<id>get-the-git-infos</id>
75+
<goals>
76+
<goal>revision</goal>
77+
</goals>
78+
<phase>initialize</phase>
79+
</execution>
80+
</executions>
81+
<configuration>
82+
<generateGitPropertiesFile>true</generateGitPropertiesFile>
83+
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
84+
<includeOnlyProperties>
85+
<includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
86+
<includeOnlyProperty>^git.commit.id.(abbrev|full)$</includeOnlyProperty>
87+
</includeOnlyProperties>
88+
<commitIdGenerationMode>full</commitIdGenerationMode>
89+
</configuration>
90+
</plugin>
6891
</plugins>
6992
</build>
7093

@@ -86,4 +109,4 @@
86109
<version>1.0-SNAPSHOT</version>
87110
</dependency>
88111
</dependencies>
89-
</project>
112+
</project>

0 commit comments

Comments
 (0)