Skip to content

misc

misc #16

Workflow file for this run

name: autobuild
on:
push:
tags:
- "*"
env:
PROJECT_NAME: "ASFBuffBot"
DOTNET_SDK_VERSION: 7.0.x
jobs:
build:
strategy:
fail-fast: false
matrix:
language: [zh-Hans]
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/[email protected]
with:
submodules: recursive
- name: Setup .NET Core
uses: actions/[email protected]
with:
dotnet-version: ${{ env.DOTNET_SDK_VERSION }}
- name: Verify .NET Core
run: dotnet --info
# - name: Change language file to ${{ matrix.language }}
# shell: pwsh
# run: |
# $projectName = "${{ env.PROJECT_NAME }}";
# $language = "${{ matrix.language }}";
# $localizationFolder = ".\$projectName\Localization";
# Copy-Item -Path "$localizationFolder\Langs.$language.resx" -Destination "$localizationFolder\Langs.resx" -Force;
- name: Restore packages in preparation for ${{ env.PROJECT_NAME }} publishing
run: dotnet restore ${{ env.PROJECT_NAME }} -p:ContinuousIntegrationBuild=true --nologo
- name: Publish ${{ env.PROJECT_NAME }} ${{ matrix.language }}
run: dotnet publish ${{ env.PROJECT_NAME }} -o ./tmp/ -c Release
- name: Zip files
run: 7z a -bd -slp -tzip -mm=Deflate -mx=5 -mfb=150 -mpass=10 "./dist/${{ env.PROJECT_NAME }}-${{ matrix.language }}.zip" "./tmp/${{ env.PROJECT_NAME }}.dll"
- name: Upload ${{ env.PROJECT_NAME }} ${{ matrix.language }}
continue-on-error: true
uses: actions/[email protected]
with:
name: ${{ env.PROJECT_NAME }}-${{ matrix.language }}.zip
path: ./dist/${{ env.PROJECT_NAME }}-${{ matrix.language }}.zip
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Download ASFBuffBot-zh-Hans artifact from windows-latest
uses: actions/[email protected]
with:
name: ASFBuffBot-zh-Hans.zip
path: out
# - name: Download ASFBuffBot-en-US artifact from windows-latest
# uses: actions/[email protected]
# with:
# name: ASFBuffBot-en-US.zip
# path: out
# - name: Download ASFBuffBot-ru-RU artifact from windows-latest
# uses: actions/[email protected]
# with:
# name: ASFBuffBot-ru-RU.zip
# path: out
- name: Create ASFBuffBot GitHub release
id: github_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: ASFBuffBot ${{ github.ref_name }}
body: |
[![ASFBuffBot Release](https://img.shields.io/badge/ASFBuffBot-${{ github.ref_name }}-brightgreen)](https://github.com/chr233/ASFBuffBot/releases/tag/${{ github.ref_name }}) ![Downloads](https://img.shields.io/github/downloads/chr233/ASFBuffBot/${{ github.ref_name }}/total?label=Downloads)
使用命令 `ABBU` 自动更新插件
Use command `ABBU` to update this plugin
release created bt github actions
prerelease: true
- name: Upload ASFBuffBot-zh-Hans to GitHub release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.github_release.outputs.upload_url }}
asset_path: out/ASFBuffBot-zh-Hans.zip
asset_name: ASFBuffBot-zh-Hans.zip
asset_content_type: application/zip