Update build.yml #158
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: Build | |
on: | |
workflow_dispatch: | |
push: | |
branches: [main] | |
tags: | |
- '*' | |
pull_request: | |
branches: [main] | |
env: | |
PROJECT_NAME: BDTHPlugin | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Setup MSBuild | |
uses: microsoft/setup-msbuild@v2 | |
- name: Download Dalamud | |
run: | | |
Invoke-WebRequest -Uri https://goatcorp.github.io/dalamud-distrib/stg/latest.zip -OutFile latest.zip | |
Expand-Archive -Force latest.zip "$env:AppData\XIVLauncher\addon\Hooks\dev\" | |
- name: Build | |
run: | | |
dotnet restore | |
dotnet build --configuration Release --nologo --property:OutputPath=D:/build | |
env: | |
DOTNET_CLI_TELEMETRY_OUTPUT: true | |
- name: Create artifact | |
run: | | |
Compress-Archive -Path "D:/build/*" -DestinationPath D:/build/BDTHPlugin.zip | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: PluginZip | |
path: D:/build/BDTHPlugin.zip | |
if-no-files-found: error | |
release: | |
needs: build | |
runs-on: windows-latest | |
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
id: download | |
with: | |
pattern: PluginZip | |
- name: Get tag name | |
id: tag | |
uses: WyriHaximus/github-action-get-previous-tag@v1 | |
- name: Create release | |
uses: softprops/action-gh-release@v2 | |
with: | |
name: ${{ env.PROJECT_NAME }} ${{ steps.tag.outputs.tag }} | |
tag_name: ${{ steps.tag.outputs.tag }} | |
body: ${{ github.events.commits[0].message }} | |
files: ./BDTHPlugin.zip | |
- name: Trigger plugin repo update | |
uses: peter-evans/repository-dispatch@v1 | |
with: | |
token: ${{ secrets.PAT }} | |
repository: LeonBlade/DalamudPlugins | |
event-type: new-release |