-
Notifications
You must be signed in to change notification settings - Fork 18
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
Showing
1 changed file
with
58 additions
and
58 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 |
---|---|---|
|
@@ -2,11 +2,11 @@ name: Build | |
|
||
# Put your personal access token in a repository secret named PAT for cross-repository access | ||
|
||
on: | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
- master | ||
|
||
env: | ||
PUBLIC_NAME: FFLogsViewer | ||
|
@@ -21,73 +21,73 @@ jobs: | |
if: ${{ contains(toJSON(github.event.commits.*.message), 'build:') || contains(toJSON(github.event.commits.*.message), 'build(')}} | ||
runs-on: windows-2022 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Extract Branch | ||
id: extract_branch | ||
run: | | ||
$branch_name = 'main' | ||
$commit_messages = ${{ github.event.commits }} | ||
foreach ($commit in $commit_messages) { | ||
if ($commit.message -match 'build\(([^)]+)\):') { | ||
$branch_name = $matches[1] | ||
break | ||
} | ||
} | ||
echo "branch_name=$branch_name" >> $GITHUB_OUTPUT | ||
- name: Extract Branch | ||
id: extract_branch | ||
run: | | ||
$branch_name = 'main' | ||
$commit_messages = ${{ github.event.commits }} | ||
foreach ($commit in $commit_messages) { | ||
if ($commit.message -match 'build\(([^)]+)\):') { | ||
$branch_name = $matches[1] | ||
break | ||
} | ||
} | ||
echo "branch_name=$branch_name" >> $GITHUB_OUTPUT | ||
- name: Setup MSBuild | ||
uses: microsoft/[email protected] | ||
- name: Setup MSBuild | ||
uses: microsoft/[email protected] | ||
|
||
- name: Download Dalamud | ||
run: | | ||
$url = if (${{ steps.extract_branch.outputs.branch_name }} -eq 'main') { | ||
'https://goatcorp.github.io/dalamud-distrib/latest.zip' | ||
} else { | ||
"https://goatcorp.github.io/dalamud-distrib/${{ steps.extract_branch.outputs.branch_name }}/latest.zip" | ||
} | ||
- name: Download Dalamud | ||
run: | | ||
$url = if (${{ steps.extract_branch.outputs.branch_name }} -eq 'main') { | ||
'https://goatcorp.github.io/dalamud-distrib/latest.zip' | ||
} else { | ||
"https://goatcorp.github.io/dalamud-distrib/${{ steps.extract_branch.outputs.branch_name }}/latest.zip" | ||
} | ||
Invoke-WebRequest -Uri $url -OutFile latest.zip | ||
Expand-Archive -Force latest.zip "$env:AppData\XIVLauncher\addon\Hooks\dev\" | ||
Invoke-WebRequest -Uri $url -OutFile latest.zip | ||
Expand-Archive -Force latest.zip "$env:AppData\XIVLauncher\addon\Hooks\dev\" | ||
- name: Build | ||
run: | | ||
dotnet restore -r win ${{ env.SOLUTION_NAME }}.sln | ||
dotnet build --configuration Release | ||
- name: Build | ||
run: | | ||
dotnet restore -r win ${{ env.SOLUTION_NAME }}.sln | ||
dotnet build --configuration Release | ||
- name: Test | ||
run: | | ||
dotnet test --no-restore --verbosity normal | ||
- name: Test | ||
run: | | ||
dotnet test --no-restore --verbosity normal | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: PluginRepoZip | ||
path: ${{ env.RELEASE_DIR }} | ||
if-no-files-found: error | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: PluginRepoZip | ||
path: ${{ env.RELEASE_DIR }} | ||
if-no-files-found: error | ||
|
||
deploy: | ||
needs: build | ||
if: ${{ contains(toJSON(github.event.commits.*.message), 'build:') || contains(toJSON(github.event.commits.*.message), 'build(')}} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
repository: ${{ env.PERSONAL_PLUGIN_REPO }} | ||
token: ${{ secrets.PAT }} | ||
- uses: actions/checkout@v2 | ||
with: | ||
repository: ${{ env.PERSONAL_PLUGIN_REPO }} | ||
token: ${{ secrets.PAT }} | ||
|
||
- uses: actions/[email protected] | ||
with: | ||
name: PluginRepoZip | ||
path: plugins/${{ env.INTERNAL_NAME }} | ||
- uses: actions/[email protected] | ||
with: | ||
name: PluginRepoZip | ||
path: plugins/${{ env.INTERNAL_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.INTERNAL_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.INTERNAL_NAME }} |