misc #89
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: publish | |
on: | |
push: | |
tags: | |
- "*" | |
env: | |
PROJECT_NAME: "ASFEnhance" | |
REPO_NAME: "ASFEnhance" | |
TARGET_FILTER : "ASFEnhance.dll" | |
DOTNET_SDK_VERSION: 8.0.x | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
language: [zh-Hans, en-US, ru-RU] | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3.1.0 | |
with: | |
submodules: recursive | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v3.0.3 | |
with: | |
dotnet-version: ${{ env.DOTNET_SDK_VERSION }} | |
- name: Verify .NET Core | |
run: dotnet --info | |
- name: Change language file to ${{ matrix.language }} | |
if: ${{ matrix.language != 'zh-Hans' }} | |
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.TARGET_FILTER }}" | |
- name: Upload ${{ env.PROJECT_NAME }} ${{ matrix.language }} | |
continue-on-error: true | |
uses: actions/upload-artifact@v3.1.1 | |
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/checkout@v3.1.0 | |
- name: Download ${{ env.PROJECT_NAME }}-zh-Hans artifact from windows-latest | |
uses: actions/download-artifact@v3.0.1 | |
with: | |
name: ${{ env.PROJECT_NAME }}-zh-Hans.zip | |
path: out | |
- name: Download ${{ env.PROJECT_NAME }}-en-US artifact from windows-latest | |
uses: actions/download-artifact@v3.0.1 | |
with: | |
name: ${{ env.PROJECT_NAME }}-en-US.zip | |
path: out | |
- name: Download ${{ env.PROJECT_NAME }}-ru-RU artifact from windows-latest | |
uses: actions/download-artifact@v3.0.1 | |
with: | |
name: ${{ env.PROJECT_NAME }}-ru-RU.zip | |
path: out | |
- name: Create ${{ env.PROJECT_NAME }} GitHub release | |
uses: ncipollo/release-action@v1.12.0 | |
with: | |
artifacts: "out/*" | |
makeLatest: false | |
prerelease: true | |
tag: ${{ github.ref_name }} | |
name: ${{ env.PROJECT_NAME }} ${{ github.ref_name }} | |
body: | | |
![Release](https://img.shields.io/badge/${{ env.REPO_NAME }}-${{ github.ref_name }}-brightgreen) ![Downloads](https://img.shields.io/github/downloads/chr233/${{ env.REPO_NAME }}/${{ github.ref_name }}/total?label=Downloads) | |
Help improve translation: [![Crowdin](https://badges.crowdin.net/asfenhance/localized.svg)](https://crowdin.com/project/asfenhance) | |
--- | |
release created bt github actions |