Skip to content

Commit

Permalink
adjust workflow for snapshot tagging
Browse files Browse the repository at this point in the history
  • Loading branch information
wandmagic committed Oct 7, 2024
1 parent 8308fe8 commit 7c6b7c8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
23 changes: 18 additions & 5 deletions .github/workflows/release-assembly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up JDK 17
uses: actions/setup-java@v3
Expand All @@ -28,27 +30,38 @@ jobs:
- name: Build with Maven
run: mvn clean package

- name: Get version and set release name
- name: Get version and set release info
id: get_version
run: |
if [[ $GITHUB_REF == refs/tags/v* ]]; then
echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
VERSION=${GITHUB_REF#refs/tags/v}
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "TAG_NAME=v$VERSION" >> $GITHUB_OUTPUT
echo "RELEASE_NAME=Release $VERSION" >> $GITHUB_OUTPUT
echo "IS_PRERELEASE=false" >> $GITHUB_OUTPUT
else
echo "VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
COMMIT_HASH=$(git rev-parse --short HEAD)
TIMESTAMP=$(date +'%Y%m%d%H%M%S')
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
echo "TAG_NAME=v$VERSION-$COMMIT_HASH-$TIMESTAMP" >> $GITHUB_OUTPUT
echo "RELEASE_NAME=Release $VERSION ($(date +'%Y-%m-%d %H:%M:%S'))" >> $GITHUB_OUTPUT
echo "IS_PRERELEASE=true" >> $GITHUB_OUTPUT
fi
- name: List target directory
run: ls -l target/

- 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 }}
tag_name: ${{ steps.get_version.outputs.TAG_NAME }}
release_name: ${{ steps.get_version.outputs.RELEASE_NAME }}
draft: false
prerelease: false
prerelease: ${{ steps.get_version.outputs.IS_PRERELEASE }}

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_dispatch:

jobs:
build-and-release:
build-and-test:
runs-on: ubuntu-latest
permissions:
contents: write
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ class OscalVerticle : CoroutineVerticle() {
ctx.response()
.setStatusCode(200) // HTTP 200 OK
.putHeader("Content-Type", "application/json")
.putHeader("Exit-Status", exitStatus.toString())
.end(fileContent)
}

Expand Down

0 comments on commit 7c6b7c8

Please sign in to comment.