Skip to content

Commit e175af8

Browse files
committed
Artifact uploading
1 parent 5032678 commit e175af8

6 files changed

Lines changed: 65 additions & 16 deletions

File tree

‎.actions/bin/getjar‎

1.96 MB
Binary file not shown.

‎.actions/bin/removeLime‎

24 Bytes
Binary file not shown.

‎.actions/build.ps1‎

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
$Env:GOOS = "linux"; $Env:GOARCH = "amd64"
2-
& "${ENV:USERPROFILE}\source\repos\GoPowered\bin\Release\net10.0\GoPowered.exe" build
3-
cd .gopowered/compile/go
4-
go build -buildvcs=false
5-
cd ../../..
2+
63
mkdir bin -ErrorAction Ignore
7-
move .gopowered/compile/go/go ./bin/removeLime -Force
8-
git add ./bin/removeLime
4+
5+
function build()
6+
{
7+
cd scripts/$args
8+
& "${ENV:USERPROFILE}\source\repos\GoPowered\bin\Release\net10.0\GoPowered.exe" build
9+
cd .gopowered/compile/go
10+
go build -buildvcs=false
11+
cd ../../..
12+
cd ../..
13+
move scripts/$args/.gopowered/compile/go/go ./bin/$args -Force
14+
git add ./bin/$args
15+
}
16+
17+
build removeLime
18+
build getjar

‎.actions/scripts/getjar/getjar.go‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package main
2+
3+
import "strings"
4+
import "fmt"
5+
import "os"
6+
7+
func main() {
8+
fp, err := os.Open("build/libs")
9+
if err != nil {
10+
panic(err)
11+
}
12+
13+
defer fp.Close()
14+
15+
names, err := fp.Readdirnames(0)
16+
if err != nil {
17+
panic(err)
18+
}
19+
20+
for _, name := range names {
21+
if !strings.Contains(name, "-sources") {
22+
fmt.Print(name[:len(name) - 4])
23+
return
24+
}
25+
}
26+
27+
os.Exit(1)
28+
}

‎.github/workflows/gradle.yml‎

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ on:
1313

1414
env:
1515
ACTIONS_SKIP_PUBLISHING: 1
16+
gen_sources: 1
1617

1718
jobs:
1819
build:
@@ -37,16 +38,26 @@ jobs:
3738
- name: Build with Gradle Wrapper
3839
run: "chmod u+x .actions/bin/removeLime; .actions/bin/removeLime; chmod u+x gradlew; ./gradlew build"
3940

40-
# NOTE: The Gradle Wrapper is the default and recommended way to run Gradle (https://docs.gradle.org/current/userguide/gradle_wrapper.html).
41-
# If your project does not have the Gradle Wrapper configured, you can use the following configuration to run Gradle with a specified version.
42-
#
43-
# - name: Setup Gradle
44-
# uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
45-
# with:
46-
# gradle-version: '8.9'
47-
#
48-
# - name: Build with Gradle 8.9
49-
# run: gradle build
41+
- name: Define uploads
42+
run: |
43+
chmod u+x .actions/bin/getjar
44+
echo "jarPath=$(.actions/bin/getjar)" >> $GITHUB_ENV
45+
46+
- name: Upload the runtime artifact
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: ${{ env.jarPath }}.jar
50+
path: build/libs/${{ env.jarPath }}.jar
51+
if-no-files-found: error
52+
retention-days: 5
53+
54+
- name: Upload the sources artifact
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: ${{ env.jarPath }}-sources.jar
58+
path: build/libs/${{ env.jarPath }}-sources.jar
59+
if-no-files-found: error
60+
retention-days: 5
5061

5162
dependency-submission:
5263

0 commit comments

Comments
 (0)