Skip to content

Upload full source to release. #232

Upload full source to release.

Upload full source to release. #232

Workflow file for this run

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:
runs-on: ubuntu-latest
steps:
- name: Clone.
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install prerequisites.
run: |
pip install git-archive-all
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: ${{ env.UPLOAD_URL }}
asset_path: ./dist/${{ env.TAG }}
asset_label: Source code (tar.gz, full)
asset_name: ${{ env.TAG }}
asset_content_type: application/x-gzip