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 4e18dd9
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 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,31 @@ 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: Set upload URL.
run: |
REPO="${{ github.repository }}"
FILE_PATH="${{ env.TAG }}"
UPLOAD_URL="https://uploads.github.com/repos/$REPO/releases/${{ github.event.release.id }}/assets?name=$FILE_PATH"
echo "UPLOAD_URL=$UPLOAD_URL" >> $GITHUB_ENV
- name: Upload.
uses: lovasoa/upload-release-asset@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
upload_url: ${{ env.UPLOAD_URL }}
asset_path: ./dist/${{ env.TAG }}
asset_label: Source code (tar.gz, full)
asset_name: ${{ env.TAG }}
Expand Down

0 comments on commit 4e18dd9

Please sign in to comment.