Don't show an error when using Earthly Star twice #30
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: Microdancer | |
on: | |
push: | |
branches: ["*"] | |
tags-ignore: ["*"] | |
create: | |
jobs: | |
build-and-deploy: | |
env: | |
ProgressPreference: "SilentlyContinue" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 8.0.300 | |
- name: Restore dependencies | |
env: | |
HUSKY: 0 | |
run: | | |
dotnet restore -p:TargetFramework=net8.0 | |
shell: pwsh | |
- name: Download Dalamud | |
run: | | |
Invoke-WebRequest https://goatcorp.github.io/dalamud-distrib/latest.zip -OutFile latest.zip | |
Expand-Archive -Path latest.zip -DestinationPath dalamud-distrib | |
shell: pwsh | |
- name: Edit package manifest | |
run: | | |
$ver = (./scripts/get-version.ps1).Version | |
$path = './src/Microdancer.json' | |
$content = Get-Content -path $path | |
$content = $content -replace '1.0.0.0',$ver | |
Set-Content -Path $path -Value $content | |
shell: pwsh | |
- name: Build | |
env: | |
HUSKY: 0 | |
run: | | |
$ver = (./scripts/get-version.ps1).Version | |
Invoke-Expression 'dotnet build --no-restore --configuration Release --nologo -p:TargetFramework=net8.0 -p:Version=$ver -p:AssemblyVersion=$ver -p:FileVersion=$ver' | |
shell: pwsh | |
- name: Package | |
run: | | |
# Get version and branch | |
$verObj = ./scripts/get-version.ps1 | |
$ver = $verObj.Version | |
$branch = $verObj.Branch | |
# Get package folder | |
$pkg_folder = './bin/Release/Microdancer' | |
# Get repo file | |
$path = './base_repo.json' | |
# Replace version and file names in repo file | |
$content = Get-Content -path $path | |
$content = $content -replace '1.0.0.0',$ver | |
$content = $content -replace 'icon.png',"icon${branch}.png" | |
$content = $content -replace 'latest.zip',"latest${branch}.zip" | |
# Remove old JSON file | |
Remove-Item -Path "${pkg_folder}/Microdancer.json" | |
# Create repo file | |
$new_path = "${pkg_folder}/Microdancer${branch}.json" | |
Set-Content -Path $new_path -Value $content | |
# Copy icon | |
Copy-Item 'images/icon.png' "bin/Release/Microdancer/icon${branch}.png" | |
# Rename zip file | |
Rename-Item -Path "${pkg_folder}/latest.zip" -NewName "latest${branch}.zip" | |
Write-Output "Created package:" | |
Write-Output "" | |
Write-Output "Files:" | |
Get-ChildItem "${pkg_folder}" -Name | |
Write-Output "" | |
Write-Output "Repo manifest:" | |
$content | |
Write-Output "" | |
shell: pwsh | |
- name: Deploy (S3) | |
uses: reggionick/s3-deploy@v3 | |
if: ${{ !env.ACT }} | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
ACT: ${{ env.ACT }} | |
with: | |
folder: bin/Release/Microdancer | |
bucket: ${{ secrets.AWS_S3_BUCKET }} | |
bucket-region: us-east-1 | |
no-cache: true |