Skip to content

Commit d6b79fd

Browse files
author
Francisco Solis
committed
Updated Build Script
1 parent ba2ba35 commit d6b79fd

File tree

1 file changed

+44
-38
lines changed

1 file changed

+44
-38
lines changed

.github/workflows/gradle-build.yml

Lines changed: 44 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,55 @@
1-
name: Java CI
1+
name: "Build and Deploy"
22
on:
33
release:
4-
types: [published,prereleased]
4+
types: [published,edited]
55
jobs:
66
build:
7-
# Setup the OS
7+
# Set up the OS
88
runs-on: ubuntu-latest
9-
permissions:
10-
contents: read
11-
packages: write
129
env:
10+
# Nexus credentials and GitHub token
1311
NEXUS_USERNAME: '${{ secrets.NEXUS_USERNAME }}'
1412
NEXUS_PASSWORD: '${{ secrets.NEXUS_PASSWORD }}'
1513
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
14+
# Set environment
15+
env: 'prod'
1616
steps:
17-
# Checkout the code
18-
- name: Ceckout the Code
19-
uses: actions/checkout@v2
20-
# Install java and maven
21-
- name: Set up JDK 1.8
22-
uses: actions/setup-java@v2
23-
with:
24-
distribution: adopt
25-
java-version: 8
26-
# Validate Gradle Wrapper
27-
- name: Validate Gradle Wrapper
28-
uses: gradle/wrapper-validation-action@v1
29-
# Test and deploy
30-
- name: Make gradle executable
31-
run: chmod +x gradlew
32-
- name: Test and Deploy with Gradle
33-
run: ./gradlew clean test shadow publish
17+
# Checkout the Code
18+
- name: Checkout Code
19+
uses: actions/checkout@v2
20+
# Set up git hashes environment variables
21+
- name: Git Hashes
22+
uses: Im-Fran/[email protected]
23+
# Set up version from tag environment variables
24+
- name: Version from Tag Action
25+
uses: Im-Fran/[email protected]
26+
with:
27+
remove-first-character: 'v'
28+
# Set up the JDK
29+
- name: Set up JDK 8
30+
uses: actions/setup-java@v2
31+
with:
32+
distribution: adopt
33+
java-version: 8
34+
# Validate Gradle Wrapper
35+
- name: Validate Gradle Wrapper
36+
uses: gradle/wrapper-validation-action@v1
37+
# Make gradle executable
38+
- name: Make gradle executable
39+
run: chmod +x gradlew
40+
# Clean, Test, Publish and Build (in that order to save the artifact to the action)
41+
- name: Test, Deploy and Build with Gradle
42+
run: ./gradlew clean test publish shadow
3443
# Now we store the artifact in the action
35-
- name: Create & Copy artifact
36-
run: mkdir -p ./artifacts && cp build/libs/SuperCoreAPI.jar ./artifacts/
37-
- name: Upload the artifact
38-
uses: actions/upload-artifact@v2
39-
with:
40-
name: SuperCoreAPI
41-
path: ./artifacts/SuperCoreAPI.jar
42-
- name: Deploy Javadoc
43-
uses: JamesIves/[email protected]
44-
with:
45-
branch: gh-pages
46-
folder: build/docs/javadoc
47-
clean: true
48-
49-
44+
- name: Upload the artifact
45+
uses: actions/upload-artifact@v2
46+
with:
47+
name: SuperCoreAPI
48+
path: ./build/libs/SuperCoreAPI.jar
49+
# Now we deploy the documents to GitHub pages
50+
- name: Deploy Javadoc
51+
uses: JamesIves/[email protected]
52+
with:
53+
branch: gh-pages
54+
folder: build/docs/javadoc
55+
clean: true

0 commit comments

Comments
 (0)