Skip to content

Commit

Permalink
Stage release
Browse files Browse the repository at this point in the history
  • Loading branch information
dhadka committed Dec 25, 2023
1 parent 1b3b535 commit 343c65e
Showing 1 changed file with 34 additions and 7 deletions.
41 changes: 34 additions & 7 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
name: Package

on:
push:
#push:
workflow_dispatch:
inputs:
create_release:
description: 'Set to create a new release'
version:
type: string
description: The version to publish
required: true
publish_github:
description: 'Create draft GitHub release'
default: true
type: boolean

jobs:
Expand Down Expand Up @@ -61,13 +66,35 @@ jobs:
path: |
./target/bundle
release:
if: inputs.create_release
publish:
if: inputs.publish_github
runs-on: ubuntu-latest
needs: package
steps:
- uses: actions/download-artifact@v4

- name: Extract release contents
- name: Install required software
run: |
ls .
sudo apt install xmlstarlet
- name: Get project settings
run: |
shortname=$(xmlstarlet sel -N x="http://maven.apache.org/POM/4.0.0" -t -v "//x:project/x:artifactId/text()" pom.xml)
version=$(xmlstarlet sel -N x="http://maven.apache.org/POM/4.0.0" -t -v "//x:project/x:version/text()" pom.xml)
echo "BUILD_NAME=${shortname}" >> $GITHUB_ENV
echo "BUILD_VERSION=${version}" >> $GITHUB_ENV
- name: Validate version number
run: |
[ "${{ inputs.version }}" == "${BUILD_VERSION}" ] || (>&2 echo "Version does not match value in pom.xml"; exit -1)
- name: Show content
run: ls -R .

- name: Stage GitHub release
run: |
gh release create "v${{ inputs.version }}" --draft --title "Version ${{ inputs.version }}" \
J3-Windows/j3-${{ inputs.version }}.msi \
J3-Linux/j3-${{ inputs.version }}.deb
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 343c65e

Please sign in to comment.