Browse Source

Upload files to artifact

pull/58/head
Ike Johnson-Woods 2 years ago
parent
commit
4fcaf88bfd
  1. 36
      .github/workflows/maven.yml
  2. 24
      .github/workflows/pull_request.yml

36
.github/workflows/maven.yml

@ -0,0 +1,36 @@
name: Push & Pull Request CI
on:
push:
pull_request:
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- name: Build with Maven
run: mvn -B package
- name: Locate built JARfile
id: jar
run: echo "jarfile=$(find build/libs/ -name "keycloak-discord-*.jar" -not -name "*slim*" -not -name "*source*")" >> $GITHUB_OUTPUT
- name: Set Artifact name
id: jarname
run: echo "jarname=$(find build/libs/ -name "keycloak-discord-*.jar" -not -name "*slim*" -not -name "*source*" | sed 's:.*/::')" >> $GITHUB_OUTPUT
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ steps.jarname.outputs.jarname }}
path: ${{ steps.jar.outputs.jarfile }}

24
.github/workflows/pull_request.yml

@ -1,24 +0,0 @@
name: Pull Request CI
on: [pull_request]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Cache for maven
uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
run: mvn -B package
Loading…
Cancel
Save