-
Notifications
You must be signed in to change notification settings - Fork 8
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
7bbf5b5
commit d086b70
Showing
1 changed file
with
85 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,85 @@ | ||
name: Build & deploy to canary | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
|
||
env: | ||
PLUGIN_NAME: Kapture | ||
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/latest.zip -OutFile latest.zip | ||
Expand-Archive -Force latest.zip "$env:AppData\XIVLauncher\addon\Hooks\dev\" | ||
- name: Install GitVersion | ||
uses: gittools/actions/gitversion/setup@v0.9.7 | ||
with: | ||
versionSpec: '5.x' | ||
- name: Use GitVersion | ||
id: gitversion | ||
uses: gittools/actions/gitversion/execute@v0.9.7 | ||
- name: Build | ||
run: | | ||
dotnet build ./src --no-restore --configuration Release --nologo /property:Version=${{steps.gitversion.outputs.MajorMinorPatch}} | ||
- name: Upload a Build Artifact | ||
uses: actions/upload-artifact@v2.2.1 | ||
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 | ||
|
||
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}} |