Skip to content

Commit

Permalink
ci: Create release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
itsamirhn committed Jun 5, 2024
1 parent 0c150ca commit dec40c8
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Release JAR

on:
push:
tags:
- "v*"

permissions:
contents: write

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'

- name: Build with Maven
run: mvn -B package --file pom.xml

- name: Create Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false

- name: Upload Artifact
id: upload_artifact
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/Chess-1.0-SNAPSHOT.jar
asset_name: Chess.jar
asset_content_type: application/java-archive

0 comments on commit dec40c8

Please sign in to comment.