Skip to content

Commit

Permalink
publish
Browse files Browse the repository at this point in the history
  • Loading branch information
AnAwesomGuy committed Aug 28, 2024
1 parent 35643be commit 5a3f920
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/buildAndTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ jobs:
- name: upload build artifacts
uses: actions/upload-artifact@v4
with:
with: normal
name: normal
path: build/libs/*.jar
compression-level: 1

build_5:
runs-on: ubuntu-latest
steps:
Expand Down
81 changes: 81 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Publish Jars

permissions:
contents: write

on:
workflow_dispatch:
inputs:
release_name:
description: 'The name of the release'
required: true
type: string
release_body:
description: 'The description of the release'
required: true
type: string

jobs:
build_latest:
runs-on: ubuntu-latest
steps:
- name: checkout sources
uses: actions/checkout@v4
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v2
- name: setup java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
- name: Test
run: |
chmod +x ./gradlew
./gradlew runMainTest
- name: upload build artifacts
uses: actions/upload-artifact@v4
with:
name: normal
path: build/libs/*.jar
compression-level: 1

build_5:
runs-on: ubuntu-latest
steps:
- name: checkout sources
uses: actions/checkout@v4
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v2
- name: setup java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 8
- name: setup gradle
uses: gradle/actions/setup-gradle@v4
- name: run test
run: |
chmod +x ./gradlew
./gradlew java5Jar
- name: upload build artifacts
uses: actions/upload-artifact@v4
with:
name: java-5
path: build/libs/*.jar
compression-level: 1

publish:
runs-on: ubuntu-latest
steps:
- name: download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts/
merge-multiple: true
- name: create release
uses: softprops/action-gh-release@v2
with:
name: ${{ inputs.release_name }}
body: ${{ inputs.release_body }}
files: ${{ ls -1 }}
tag_name: ${{ ls -AU artifacts | head -1 }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.gradle
build/
generated/
artifacts/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/
Expand Down

0 comments on commit 5a3f920

Please sign in to comment.