-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7a4e758
commit 0e37ac4
Showing
4 changed files
with
89 additions
and
185 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,101 @@ | ||
name: Build plugin | ||
name: Build & deploy | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
|
||
env: | ||
PLUGIN_NAME: SillyChat | ||
PERSONAL_PLUGIN_REPO: kalilistic/DalamudPluginRepo | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
steps: | ||
|
||
- name: Checkout source | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup .NET for Build | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 5.0.100 | ||
|
||
- name: Restore dependencies | ||
run: dotnet restore ./src | ||
|
||
- 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: Install GitVersion | ||
uses: gittools/actions/gitversion/[email protected] | ||
with: | ||
versionSpec: '5.x' | ||
|
||
- name: Use GitVersion | ||
id: gitversion | ||
uses: gittools/actions/gitversion/[email protected] | ||
|
||
- name: Build | ||
run: | | ||
dotnet build ./src --no-restore --configuration Release --nologo /property:Version=${{steps.gitversion.outputs.MajorMinorPatch}} | ||
- name: Run xUnit Tests | ||
run: | | ||
dotnet test ./src/${{env.PLUGIN_NAME}}.Test/${{env.PLUGIN_NAME}}.Test.csproj | ||
- name: Checkout source | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup .NET for Build | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 5.0.100 | ||
- name: Restore dependencies | ||
run: dotnet restore ./src | ||
- 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: Install GitVersion | ||
uses: gittools/actions/gitversion/[email protected] | ||
with: | ||
versionSpec: '5.x' | ||
- name: Use GitVersion | ||
id: gitversion | ||
uses: gittools/actions/gitversion/[email protected] | ||
- name: Build | ||
run: | | ||
dotnet build ./src --no-restore --configuration Release --nologo /property:Version=${{steps.gitversion.outputs.MajorMinorPatch}} | ||
- name: Upload a Build Artifact | ||
uses: actions/[email protected] | ||
with: | ||
name: PluginRepoZip | ||
path: ./src/${{env.PLUGIN_NAME}}/bin/Release/${{env.PLUGIN_NAME}} | ||
if-no-files-found: error | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{steps.gitversion.outputs.FullSemVer}} | ||
release_name: ${{env.PLUGIN_NAME}} ${{steps.gitversion.outputs.MajorMinorPatch}} | ||
draft: false | ||
prerelease: false | ||
- name: Upload Release Asset | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
with: | ||
upload_url: ${{steps.create_release.outputs.upload_url}} | ||
asset_path: ./src/${{env.PLUGIN_NAME}}/bin/Release/${{env.PLUGIN_NAME}}/latest.zip | ||
asset_name: ${{env.PLUGIN_NAME}}.zip | ||
asset_content_type: application/zip | ||
|
||
- name: Upload a Build Artifact | ||
uses: actions/[email protected] | ||
with: | ||
path: | | ||
./src/${{env.PLUGIN_NAME}}/bin/Release/out/${{env.PLUGIN_NAME}}/* | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{steps.gitversion.outputs.FullSemVer}} | ||
release_name: ${{env.PLUGIN_NAME}} ${{steps.gitversion.outputs.MajorMinorPatch}} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Upload Release Asset | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
with: | ||
upload_url: ${{steps.create_release.outputs.upload_url}} | ||
asset_path: ./src/${{env.PLUGIN_NAME}}/bin/Release/out/${{env.PLUGIN_NAME}}/latest.zip | ||
asset_name: ${{env.PLUGIN_NAME}}.zip | ||
asset_content_type: application/zip | ||
deploy: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
repository: ${{env.PERSONAL_PLUGIN_REPO}} | ||
token: ${{secrets.PAT}} | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: PluginRepoZip | ||
path: plugins/${{env.PLUGIN_NAME}} | ||
- uses: EndBug/add-and-commit@v7 | ||
with: | ||
add: --all | ||
author_name: GitHub Action | ||
author_email: github-actions[bot]@users.noreply.github.com | ||
message: Update ${{env.PLUGIN_NAME}} | ||
|
||
pull_request: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download artifact | ||
uses: actions/download-artifact@v2 | ||
id: download-artifact | ||
with: | ||
name: PluginRepoZip | ||
path: PluginArtifact | ||
- uses: kalilistic/DalamudPluginPR@master | ||
with: | ||
enabled: true | ||
token: ${{secrets.PAT}} | ||
artifact_path: ${{steps.download-artifact.outputs.download-path}} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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