chore: add OTA workflow

This commit is contained in:
Horror Proton
2022-10-28 03:58:41 +08:00
committed by MistEO
parent f786dfe9de
commit a7523c2a99
2 changed files with 94 additions and 0 deletions

38
.github/workflows/release-ota.yml vendored Normal file
View File

@@ -0,0 +1,38 @@
name: release-ota
on:
release:
types: [published]
workflow_dispatch:
inputs:
limit:
description: 'Number of releases to fetch, 2 at least'
required: false
default: 21
type: number
jobs:
make-ota:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v3
- name: "Build OTA"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mkdir -pv build-ota && cd build-ota
../tools/OTAPacker/build.sh 'MaaAssistantArknights/MaaAssistantArknights' ${{ inputs.limit }}
- name: "Set tag"
id: set_tag
run: |
echo "release_tag=$(head -n 1 build-ota/releases)" >> $GITHUB_ENV
- name: "Upload to MaaRelease"
uses: svenstaro/upload-release-action@v2
with:
repo_name: ${{ format('{0}/{1}', github.repository_owner, 'MaaRelease') }}
repo_token: ${{ secrets.MAARELEASE_RELEASE }}
file_glob: true
file: build-ota/*.zip
tag: ${{ env.release_tag }}
overwrite: true