Skip to content

build: update GitHub actions to use latest versions (main) #280

build: update GitHub actions to use latest versions (main)

build: update GitHub actions to use latest versions (main) #280

Workflow file for this run

name: Build
on: [ push ]
jobs:
build:
runs-on: ubuntu-latest
# We want to run on external PRs, but not on our own internal PRs as they'll be run
# by the push to the branch.
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
steps:
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: Cache Gradle
id: cache-gradle
uses: actions/cache@v3
with:
path: ~/.gradle
key: ${{ runner.os }}-gradle
- uses: actions/checkout@v4
- name: Grant execute permission to gradlew
run: chmod +x gradlew
- name: Build
run: ./gradlew build shadowJar -x test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_URL: "https://api.github.com/"
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
path: "**/build/libs"
release:
needs: [ build ]
if: github.ref == 'refs/heads/main' || 'refs/heads/beta' || github.ref == 'refs/heads/alpha'
runs-on: ubuntu-latest
steps:
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Set up Node.js v20.x
uses: actions/setup-node@v4
with:
node-version: "20.x"
- name: Cache Gradle
id: cache-gradle
uses: actions/cache@v3
with:
path: ~/.gradle
key: ${{ runner.os }}-gradle
- uses: actions/checkout@v4
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Grant execute permission for update-versions.sh
run: chmod +x update-versions.sh
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_URL: "https://api.github.com/"
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
run: npx --legacy-peer-deps -p @semantic-release/changelog -p @semantic-release/git -p @semantic-release/exec -p gradle-semantic-release-plugin -p semantic-release semantic-release