AqualinkD/.github/workflows/release_workflow.yml

60 lines
2.3 KiB
YAML

name: AqualinkD create release .tar.gz
on:
push:
branches: [ main ]
tags:
- 'v*.*.*'
workflow_dispatch: # Allow manual run
inputs: # ADDED INPUTS to request the specific tag
tag_name:
description: 'The existing tag/release name (e.g., v2.6.11) to pull code from and upload assets to.'
type: string
required: true
jobs:
create_release:
runs-on: ubuntu-latest
steps:
- name: Checkout specific release tag
uses: actions/checkout@v4
with:
# If event is 'push', use the specific commit SHA (github.sha).
# Otherwise (workflow_dispatch), use the user-provided tag name.
ref: ${{ github.event_name == 'push' && github.sha || github.event.inputs.tag_name }}
- name: Print Determined Tag Name
run: |
TAG_NAME="${{ github.event_name == 'push' && github.ref_name || github.event.inputs.tag_name }}"
echo "---------------------------------"
echo "Workflow Event: ${{ github.event_name }}"
echo "Tag to be used for Release: $TAG_NAME"
echo "---------------------------------"
- name: Create release archive
# This step correctly archives both resulting binaries from the workspace
run: tar -czvf aqualinkd-release.tar.gz web/ release/
- name: Update GitHub Release and Upload Artifact
uses: softprops/action-gh-release@v2
with:
# If event is 'push', use the tag name from the ref (github.ref_name).
# Otherwise, use the user-provided tag name.
tag_name: ${{ github.event_name == 'push' && github.ref_name || github.event.inputs.tag_name }}
# DYNAMIC LOGIC for 'name':
# Same dynamic logic applied to the release name.
name: Release ${{ github.event_name == 'push' && github.ref_name || github.event.inputs.tag_name }}
# Set draft to false if the intention is to publish/update a final version.
draft: false
# Overwrite is necessary to attach assets to an existing release.
overwrite: true
# The files parameter should match the file you created in the previous step.
files: aqualinkd-release.tar.gz
env:
# The GITHUB_TOKEN is automatically provided by GitHub Actions
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}