Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

chore(deps): update softprops/action-gh-release action to v2 #119

chore(deps): update softprops/action-gh-release action to v2

chore(deps): update softprops/action-gh-release action to v2 #119

Workflow file for this run

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@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
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@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
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@d99959edae48b5ffffd7b00da66dcdb0a33a52ee # v2.0.2
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 }}