mirror of
https://github.com/truewhile/MeBox.git
synced 2026-09-28 11:16:37 +08:00
65 lines
1.8 KiB
YAML
65 lines
1.8 KiB
YAML
name: Publish release packages
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: 'Release tag to publish, for example MediaStationGo-v0.0.32'
|
|
required: true
|
|
type: string
|
|
ref:
|
|
description: 'Git ref to build from'
|
|
required: false
|
|
default: main
|
|
type: string
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
RELEASE_VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.version || github.ref_name }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || github.ref }}
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.25'
|
|
cache: true
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
cache: npm
|
|
cache-dependency-path: web/package-lock.json
|
|
|
|
- name: Build release packages
|
|
run: ./scripts/package-release.sh
|
|
env:
|
|
VERSION: ${{ env.RELEASE_VERSION }}
|
|
|
|
- name: Generate checksums
|
|
run: |
|
|
cd dist-release
|
|
sha256sum * > SHA256SUMS.txt
|
|
|
|
- name: Publish GitHub Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: |
|
|
dist-release/*.tar.gz
|
|
dist-release/*.zip
|
|
dist-release/SHA256SUMS.txt
|
|
generate_release_notes: true
|
|
tag_name: ${{ env.RELEASE_VERSION }}
|
|
target_commitish: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || github.sha }}
|
|
# GitHub immutable releases reject deleting/replacing existing assets.
|
|
# Keep reruns idempotent by skipping same-name assets instead of
|
|
# deleting them first.
|
|
overwrite_files: false
|