Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change release flow #111

Merged
merged 4 commits into from
Dec 16, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Change release flow
erikbosch committed Dec 12, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 1f1b57cb43e064865322427875b8efc3d8d7d598
19 changes: 6 additions & 13 deletions .github/workflows/create_draft_release.yml
Original file line number Diff line number Diff line change
@@ -14,17 +14,11 @@
name: Create Draft Release

on:
workflow_dispatch: # input version manually. Overrides push tag
inputs:
tag:
description: "Release version, eg:latest, 0.2.1"
required: true
default: "0.0.0"
workflow_dispatch: # select tag when creating
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
workflow_dispatch: # select tag when creating
on:
release:
types: [published]

use this instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would be the intended use case? We have an action further down in the script ( softprops/action-gh-release@v2) to create a release, and that becomes quite useless if we already have created a release.

And adding on:release is a bit superfluous. If you create a new release, and the tag does not exist since before a new tag will be created and that will anyway trigger this workflow.

I am actually considering if we should remove workflow_dispatch - I do not see that many use-cases for it, except possibly if you have yanked a release and want to rebuild a new release for the same tag.

push:
tags:
- "*.*.*"

# As of today trigger only manually
#push:
# tags:
# - "*.*.*"

# Needed if GITHUB_TOKEN by default do not have right to create release
permissions:
@@ -87,16 +81,15 @@ jobs:
ls -R build-artifacts
cd build-artifacts
# Rename, add release name (usually tag)
for f in databroker*.tar.gz; do mv "$f" "$(echo "$f" | sed s/.tar.gz/-${{ needs.get_version.outputs.version }}.tar.gz/)"; done

for f in databroker*.tar.gz; do mv "$f" "$(echo "$f" | sed s/.tar.gz/-${{ github.ref_name }}.tar.gz/)"; done

- name: Create release
id: create_release
uses: softprops/action-gh-release@v2
# if: startsWith(github.ref, 'refs/tags/'
with:
draft: true
tag_name: KUKSA Databroker ${{ needs.get_version.outputs.version }}
name: KUKSA Databroker ${{ github.ref_name }}
fail_on_unmatched_files: true
files: |
build-artifacts/*