Merge pull request #62 from AtomPilz-DevTeam/renovate/all-minor-patch #286
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
name: CI | |
on: | |
push: | |
branches: [ "**" ] | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Set up JDK 17 | |
uses: actions/[email protected] | |
with: | |
java-version: 17 | |
distribution: 'adopt' | |
cache: gradle | |
- name: Validate Gradle wrapper | |
uses: gradle/[email protected] | |
- name: Build with Gradle | |
run: ./gradlew build --warning-mode all | |
createJar: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Set up JDK 17 | |
uses: actions/[email protected] | |
with: | |
java-version: 17 | |
distribution: 'adopt' | |
cache: gradle | |
- name: Validate Gradle wrapper | |
uses: gradle/[email protected] | |
- name: Set version env variable | |
run: | | |
echo "runnumber=${{ github.run_number }}" >> $GITHUB_ENV | |
- run: ./gradlew jar | |
- name: Upload artifact | |
uses: actions/[email protected] | |
with: | |
name: StationofdoomPlugin | |
path: build/libs | |
releaseJar: | |
runs-on: ubuntu-latest | |
needs: createJar | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: StationofdoomPlugin | |
path: build/libs | |
- name: Check folder | |
run: ls build/libs | |
- name: Get file name | |
id: get_filename | |
run: | | |
FILE_PATH=$(find build/libs -name "*.jar" | head -n 1) | |
FILE_NAME=$(basename "$FILE_PATH") | |
version=$(echo "$FILE_NAME" | grep -o '[0-9.]\+') | |
version="${version%.}" | |
echo "$version" | |
echo "FILENAME=$version" >> $GITHUB_ENV | |
- name: Release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "build/libs/*.jar" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
prerelease: true | |
tag: "v${{ env.FILENAME }}" |