Skip to content

Commit

Permalink
chore: Add version to draft release
Browse files Browse the repository at this point in the history
  • Loading branch information
elementbound committed Nov 16, 2023
1 parent 8c1cb3f commit 0b70f27
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ permissions:
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:

jobs:
Expand All @@ -25,10 +27,17 @@ jobs:
run: godot --version
- name: Build
run: sh/build.sh
- name: Parse version
id: version
run: |
sh/version.sh envvar >> "$GITHUB_OUTPUT"
sh/version.sh
- name: Release
uses: softprops/action-gh-release@v1
env:
VERSION: ${{ steps.version.outputs.VERSION }}
with:
name: latest
name: ${{ steps.version.outputs.VERSION }}
files: build/*
draft: true
prerelease: true
4 changes: 4 additions & 0 deletions sh/version.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ source sh/shared.sh
version_major="$(echo ${version} | cut -f1 -d.)"
version_minor="$(echo ${version} | cut -f2 -d.)"
version_patch="$(echo ${version} | cut -f3 -d.)"
version="$version_major.$version_minor.$version_patch"

persist="false"

Expand All @@ -31,6 +32,9 @@ if [ $1 == "bump" ]; then

version="$version_major.$version_minor.$version_patch"
persist="true"
elif [ $1 == "envvar" ]; then
echo "VERSION=v$version"
exit 0
fi

if [ "$persist" = "true" ]; then
Expand Down

0 comments on commit 0b70f27

Please sign in to comment.