Skip to content

Commit

Permalink
Use gh to manage releases
Browse files Browse the repository at this point in the history
It looks like it can manage working with draft releases unlike actions.

Issue: #428
  • Loading branch information
mlopatkin committed Jan 26, 2025
1 parent dfa4351 commit 88b1874
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 53 deletions.
2 changes: 0 additions & 2 deletions .github/versions.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
#

ANDLOGVIEW_ENV_VERSION=sha256:5d34e961a07019b09599025c5de65f3e7d6a44b80072f92114e35bde212e41b8
# softprops/action-gh-release
RELEASE_ACTION_VERSION=c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # v2.2.1
# gradle/gradle-build-action
GRADLE_BUILD_ACTION_VERSION=842c587ad8aa4c68eeba24c396e15af4c2e9f30a # 2.9.0
DOCKER_LOGIN_ACTION_VERSION=343f7c4344506bcbf9b4de18042ae17996df046d # v3.0
Expand Down
46 changes: 24 additions & 22 deletions .github/workflow-templates/includes/releases.ftlh
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
<#macro createRelease tag prerelease="true">
uses: softprops/action-gh-release@[=RELEASE_ACTION_VERSION]
if: ${{ success() }}
with:
body_path: docs/releases/release_0.24.md # This is a temporary location
draft: true
prerelease: [=prerelease]
tag_name: [=tag]
generate_release_notes: false
make_latest: false
run: >
gh release create [=tag]
--draft
--latest=false
--notes-file docs/releases/release_0.24.md
--prerelease=[=prerelease]
--title [=tag]
--verify-tag
shell: bash
env:
GH_TOKEN: ${{ github.token }}
</#macro>
<#macro publishArtifacts tag>
uses: softprops/action-gh-release@[=RELEASE_ACTION_VERSION]
if: ${{ success() }}
with:
files: build/distributions/*
tag_name: [=tag]
fail_on_unmatched_files: true
generate_release_notes: false
make_latest: false
shell: bash
run: gh release upload [=tag] build/distributions/*
env:
GH_TOKEN: ${{ github.token }}
</#macro>
<#macro publishRelease tag prerelease="true">
uses: softprops/action-gh-release@[=RELEASE_ACTION_VERSION]
if: ${{ success() }}
with:
draft: false
prerelease: [=prerelease]
tag_name: [=tag]
generate_release_notes: false
make_latest: false
run: >
gh release edit [=tag]
--draft=false
--latest=false
--prerelease=[=prerelease]
--verify-tag
shell: bash
env:
GH_TOKEN: ${{ github.token }}
</#macro>
57 changes: 28 additions & 29 deletions .github/workflows/releasing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,24 @@ jobs:
run: |
tools/remove-release.sh "latest-snapshot" "$GITHUB_REPOSITORY"
- name: Create new release
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # v2.2.1
if: ${{ success() }}
with:
body_path: docs/releases/release_0.24.md # This is a temporary location
draft: true
prerelease: true
tag_name: latest-snapshot
generate_release_notes: false
make_latest: false
run: >
gh release create latest-snapshot
--draft
--latest=false
--notes-file docs/releases/release_0.24.md
--prerelease=true
--title latest-snapshot
--verify-tag
shell: bash
env:
GH_TOKEN: ${{ github.token }}
- name: Publish Linux and cross-platform installers
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # v2.2.1
if: ${{ success() }}
with:
files: build/distributions/*
tag_name: latest-snapshot
fail_on_unmatched_files: true
generate_release_notes: false
make_latest: false
shell: bash
run: gh release upload latest-snapshot build/distributions/*
env:
GH_TOKEN: ${{ github.token }}

build-snapshot-win:
runs-on: windows-latest
Expand Down Expand Up @@ -94,14 +94,11 @@ jobs:
--stacktrace
windowsInstallers
- name: Add Windows Installers to release
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # v2.2.1
if: ${{ success() }}
with:
files: build/distributions/*
tag_name: latest-snapshot
fail_on_unmatched_files: true
generate_release_notes: false
make_latest: false
shell: bash
run: gh release upload latest-snapshot build/distributions/*
env:
GH_TOKEN: ${{ github.token }}

publish-snapshot-release:
runs-on: ubuntu-latest
Expand All @@ -112,14 +109,16 @@ jobs:
if: github.ref == 'refs/heads/master'
steps:
- name: Publish draft release as pre-release
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # v2.2.1
if: ${{ success() }}
with:
draft: false
prerelease: true
tag_name: latest-snapshot
generate_release_notes: false
make_latest: false
run: >
gh release edit latest-snapshot
--draft=false
--latest=false
--prerelease=true
--verify-tag
shell: bash
env:
GH_TOKEN: ${{ github.token }}

build-release:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 88b1874

Please sign in to comment.