-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from Team-40-IDATT2003/12-implement-ci-pipelin…
…e-to-auto-export-project-as-jar-on-new-release Implements CI pipeline for exporting project on new release.
- Loading branch information
Showing
4 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "name": "Build project on release", | ||
| "description": "Builds and exports project as .jar file when a new github release is made", | ||
| "iconName": "maven", | ||
| "categories": ["Continuous integration", "Java", "Maven"] | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| name: Build and Attach Release JAR | ||
|
|
||
| on: | ||
| release: | ||
| types: [created] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: [self-hosted] | ||
|
|
||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: temurin | ||
| java-version: '25' | ||
| cache: maven | ||
|
|
||
| - run: mvn clean package | ||
|
|
||
| - name: Set versioned JAR name | ||
| run: echo "JAR_NAME=APPLICATION-${GITHUB_REF#refs/tags/}.jar" >> $GITHUB_ENV | ||
|
|
||
| - name: Rename JAR | ||
| run: mv target/*.jar $JAR_NAME | ||
|
|
||
| - uses: softprops/action-gh-release@v1 | ||
| with: | ||
| files: ${{ env.JAR_NAME }} | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
File renamed without changes.
File renamed without changes.