EasyTier/.github/workflows/release.yml

93 lines
2.7 KiB
YAML
Raw Normal View History

2024-08-13 00:06:12 +08:00
name: EasyTier Release
on:
workflow_dispatch:
inputs:
core_run_id:
description: 'The run id of EasyTier-Core Action in EasyTier repo'
type: number
default: 10322498549
required: true
gui_run_id:
description: 'The run id of EasyTier-GUI Action in EasyTier repo'
type: number
default: 10322498557
required: true
mobile_run_id:
description: 'The run id of EasyTier-Mobile Action in EasyTier repo'
type: number
default: 10322498555
required: true
version:
description: 'Version for this release'
2024-08-13 00:06:12 +08:00
type: string
default: 'v1.2.2'
required: true
make_latest:
description: 'Mark this release as latest'
type: boolean
default: true
required: true
2024-08-13 00:10:19 +08:00
permissions:
contents: write
2024-08-13 00:06:12 +08:00
jobs:
2024-08-13 00:10:19 +08:00
release:
2024-08-13 00:06:12 +08:00
if: contains('["KKRainbow"]', github.actor)
runs-on: ubuntu-latest
steps:
- name: Checkout
2024-08-13 00:06:12 +08:00
uses: actions/checkout@v4
- name: Download Core Artifact
uses: dawidd6/action-download-artifact@v6
with:
github_token: ${{secrets.GITHUB_TOKEN}}
run_id: ${{ inputs.core_run_id }}
repo: EasyTier/EasyTier
path: release_assets_origin
2024-08-13 00:06:12 +08:00
- name: Download GUI Artifact
uses: dawidd6/action-download-artifact@v6
with:
github_token: ${{secrets.GITHUB_TOKEN}}
run_id: ${{ inputs.gui_run_id }}
repo: EasyTier/EasyTier
path: release_assets_origin
2024-08-13 00:06:12 +08:00
- name: Download Mobile Artifact
2024-08-13 00:06:12 +08:00
uses: dawidd6/action-download-artifact@v6
with:
github_token: ${{secrets.GITHUB_TOKEN}}
run_id: ${{ inputs.mobile_run_id }}
repo: EasyTier/EasyTier
path: release_assets_origin
2024-08-13 00:06:12 +08:00
- name: Prepare release assets
2024-08-13 00:06:12 +08:00
env:
VERSION: ${{ inputs.version }}
run: |
mkdir -p release_assets
# Copy files that don't need compression
find release_assets_origin -type f \( -name "*.dmg" -o -name "*.deb" -o -name "*.exe" -o -name "*.apk" \) -exec cp {} release_assets/ \;
# Compress other files
zip -r release_assets/EasyTier-${VERSION}.zip release_assets_origin -x "*.dmg" -x "*.deb" -x "*.exe" -x "*.apk"
echo "Contents of release_assets_origin:"
ls -R release_assets_origin
echo "Contents of release_assets:"
ls -l release_assets
2024-08-13 00:06:12 +08:00
- name: Release
uses: softprops/action-gh-release@v2
with:
name: ${{ inputs.version }}
draft: true
files: ./release_assets/*
2024-08-13 00:06:12 +08:00
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ inputs.version }}