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 all commits
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
39 changes: 5 additions & 34 deletions .github/workflows/create_draft_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,43 +14,16 @@
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"

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

# Needed if GITHUB_TOKEN by default do not have right to create release
permissions:
contents: write
packages: write

jobs:
get_version:
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
version: ${{ steps.eval_version.outputs.version }}
steps:
- name: Get tag or user release version
id: eval_version
run: |
GIT_VER="${GITHUB_REF/refs\/tags\//}"
echo "### Detected tag: $GIT_VER"
if [ -n "${{ github.event.inputs.tag }}" ]; then
GIT_VER="${{ github.event.inputs.tag }}"
echo "Forced release version: $GIT_VER"
echo "version=${GIT_VER}" >> $GITHUB_OUTPUT
else
echo "version=${GIT_VER}" >> $GITHUB_OUTPUT
fi

call_kuksa_databroker_build:
uses: ./.github/workflows/kuksa_databroker_build.yml
secrets:
Expand All @@ -66,7 +39,6 @@ jobs:
runs-on: ubuntu-latest
needs:
[
get_version,
call_kuksa_databroker_build,
call_kuksa_databroker-cli_build,
]
Expand All @@ -87,16 +59,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/*
Expand Down
Loading