This repository has been archived by the owner on Mar 12, 2024. It is now read-only.
chore(deps): update actions/setup-java action to v4.1.0 #107
Workflow file for this run
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: build | |
on: | |
push: | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name != 'pull_request' || github.repository_owner != github.event.pull_request.head.repo.owner.login }} | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@9704b39bf258b59bc04b50fa2dd55e9ed76b47a8 # v4.1.0 | |
with: | |
java-version: 17 | |
distribution: 'adopt' | |
- uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Build with Maven | |
run: mvn -B -Dchangelist=-${{github.run_number}} clean verify | |
- name: Extract version | |
run: | | |
VERSION=$(cat pom.xml | grep '<revision' | grep -o -E '[0-9]+\.[0-9]+(\.[0-9]+)?') | |
echo "${VERSION}-${{github.run_number}}" > target/version.txt | |
- name: Upload plugin | |
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 | |
with: | |
name: additional-identities-plugin | |
path: | | |
target/additional-identities-plugin.hpi | |
target/version.txt | |
release: | |
needs: [build] | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Setup Git user | |
run: | | |
git config --local user.name "github-actions[bot]" | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
- name: Download plugin | |
uses: actions/download-artifact@87c55149d96e628cc2ef7e6fc2aab372015aec85 # v4.1.3 | |
with: | |
name: additional-identities-plugin | |
path: . | |
- name: Create git tag | |
run: | | |
v=$(cat version.txt) | |
git tag v$v | |
git push origin v$v | |
echo "VERSION=${v}" >> $GITHUB_ENV | |
- name: Create release | |
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1 | |
with: | |
files: additional-identities-plugin.hpi | |
name: ${{ env.VERSION }} | |
tag_name: v${{ env.VERSION }} | |
body: Relase v${{ env.VERSION }} | |
fail_on_unmatched_files: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |