Skip to content

Commit

Permalink
Create release-assembly.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
wandmagic committed Oct 4, 2024
1 parent 9602880 commit 53fb89d
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/release-assembly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Release Assembly

on:
push:
tags:
- 'v*'
workflow_dispatch:

jobs:
build-and-release:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven

- name: Build with Maven
run: mvn clean package

- name: Get version
id: get_version
run: |
if [[ $GITHUB_REF == refs/tags/v* ]]; then
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
else
echo "VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
fi
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.get_version.outputs.VERSION }}
release_name: Release ${{ steps.get_version.outputs.VERSION }}
draft: false
prerelease: false

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/server-${{ steps.get_version.outputs.VERSION }}-bin.zip
asset_name: oscal-server-${{ steps.get_version.outputs.VERSION }}.zip
asset_content_type: application/zip

0 comments on commit 53fb89d

Please sign in to comment.