dist #108
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: dist | |
# Controls when the action will run. Workflow runs when manually triggered using the UI | |
# or API. | |
on: | |
workflow_dispatch: | |
# Inputs the workflow accepts. | |
inputs: | |
release_tag: | |
description: 'Please specific a exists release tag name, such as v88' | |
# Default value if no value is explicitly provided | |
default: '' | |
# Input has to be provided for the workflow to run | |
required: true | |
test: | |
# test only | |
description: 'Whether test only' | |
# Default value if no value is explicitly provided | |
default: '' | |
# Input has to be provided for the workflow to run | |
required: false | |
package_suffix: | |
description: 'Please specific dist package suffix' | |
# Default value if no value is explicitly provided | |
default: '' | |
# Input has to be provided for the workflow to run | |
required: false | |
run_id: | |
description: 'Please specific run id' | |
# Default value if no value is explicitly provided | |
default: '' | |
# Input has to be provided for the workflow to run | |
required: false | |
libs: | |
description: "dist libs, split by ','" | |
default: '' | |
required: false | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "greet" | |
dist: | |
# The type of runner that the job will run on | |
runs-on: macos-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event.inputs.release_tag != '' || github.event.inputs.test != '' }} | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download artifacts from workflow build | |
uses: dawidd6/action-download-artifact@v3 | |
with: | |
# Optional, GitHub token | |
github_token: ${{secrets.GITHUB_TOKEN}} | |
# Required, workflow file name or ID | |
workflow: build.yml | |
workflow_conclusion: success | |
run_id: ${{ github.event.inputs.run_id }} | |
- name: Determine release tag name from input | |
run: | | |
if [ "$RELEASE_TAG_NAME" = "" ]; then | |
RELEASE_TAG_NAME=${{github.event.inputs.release_tag}} | |
echo "RELEASE_TAG_NAME=$RELEASE_TAG_NAME" >> $GITHUB_ENV | |
fi | |
- name: Prepare dist package | |
run: | | |
ls | |
source 1k/dist.sh $RELEASE_TAG_NAME '${{github.event.inputs.package_suffix}}' '${{github.event.inputs.libs}}' | |
ls | |
- name: Upload dist package to release page | |
if: ${{ env.RELEASE_TAG_NAME != '' }} | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: ${{ env.RELEASE_TAG_NAME }} | |
name: ${{ env.RELEASE_TAG_NAME }} | |
body_path: ${{ env.DIST_NOTES }} | |
files: | | |
./seprate/*.zip | |
./seprate/*.7z | |
${{ env.DIST_VERLIST }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_REPOSITORY: simdsoft/1kiss |