Skip to content

Commit

Permalink
Added ability to trigger full source Github Action manually.
Browse files Browse the repository at this point in the history
  • Loading branch information
23rd committed Mar 8, 2025
1 parent b030491 commit 5251e97
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions .github/workflows/full_source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ name: Upload full source to release.
on:
release:
types: released
workflow_dispatch:
inputs:
release_version:
description: 'The version of the release to upload'
required: true
default: 'v1.0.0'

jobs:
build:
Expand All @@ -16,19 +22,37 @@ jobs:
run: |
pip install git-archive-all
p=$(echo frk-v${GITHUB_REF##*/v}-full.tar.gz)
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
# Use the release version from the input if available.
p="frk-${{ github.event.inputs.release_version }}-full.tar.gz"
else
# Otherwise fallback to the release event.
p="frk-v${GITHUB_REF##*/v}-full.tar.gz"
fi
echo "TAG=$p" >> $GITHUB_ENV
- name: Build assets.
run: |
mkdir -p dist/
echo "$TAG"
~/.local/bin/git-archive-all ./dist/${TAG}
- name: Get release ID by tag.
id: get_release
if: github.event_name == 'workflow_dispatch'
uses: cardinalby/git-get-release-action@master
with:
tag: ${{ github.event.inputs.release_version }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Set upload URL for release event.
id: set_upload_url
if: github.event_name == 'release'
run: |
echo "upload_url=${{ github.event.release.upload_url }}" >> $GITHUB_OUTPUT
- name: Upload.
uses: lovasoa/upload-release-asset@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
upload_url: ${{ steps.get_release.outputs.upload_url || steps.set_upload_url.outputs.upload_url }}
asset_path: ./dist/${{ env.TAG }}
asset_label: Source code (tar.gz, full)
asset_name: ${{ env.TAG }}
Expand Down

0 comments on commit 5251e97

Please sign in to comment.