Skip to content

BuildRelease

BuildRelease #20

Workflow file for this run

name: BuildRelease
on:
workflow_dispatch:
inputs:
version:
description: '打包版本'
required: true
default: ''
push:
branches:
- master
- rewrite
jobs:
build:
name: 大气层打包
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 当前日期
id: date
run: |
echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
# ${{ steps.date.outputs.date }}
- name: 获取版本
id: set-version
run: |
version=${{ github.event.inputs.version }}
# version=$(cat ./VERSION | python -c 'import sys, json; f=open("./src/settings.json");print(json.loads(f.read())["version"])')
echo "version=$version" >> $GITHUB_OUTPUT
- name: 安装 Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
architecture: 'x64'
- name: 安装依赖
run: |
if [ -f ./requirements.txt ]; then pip3 install -r ./requirements.txt; fi
sudo apt install rename
- name: 打包文件
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python ./build.py -gt="$GITHUB_TOKEN" -v="v${{ steps.set-version.outputs.version }}"
rename 's/v9\.9\.9/v${{ steps.set-version.outputs.version }}/g' *.zip
- name: 发布
uses: ncipollo/release-action@v1
with:
token: "${{ secrets.GITHUB_TOKEN }}"
allowUpdates: true
tag: v${{ steps.set-version.outputs.version }}
name: Atmosphere v${{ steps.set-version.outputs.version }}
bodyFile: "CHANGELOG.md"
prerelease: false
artifacts: "*.zip"