Merge pull request #4 from chornthorn/feat/dual-auth-support #11
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: Maven Release | |
on: | |
push: | |
tags: | |
- 'v*' # Will trigger on tags that start with v (e.g. v1.0.0) | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
discussions: write # Added for releases | |
packages: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # Added to fetch all tags | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
cache: maven | |
server-id: github | |
settings-path: ${{ github.workspace }} | |
- name: Get version from tag | |
id: get_version | |
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV | |
- name: Build with Maven | |
run: mvn -B clean package --file pom.xml | |
- name: Create Release and Upload Assets | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: Release v${{ env.VERSION }} 🚀 | |
files: | | |
target/khode-two-factor-auth-${{ env.VERSION }}.jar | |
draft: false | |
prerelease: false | |
fail_on_unmatched_files: false | |
generate_release_notes: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |