yerx
This commit is contained in:
115
.github/workflows/release.yml
vendored
115
.github/workflows/release.yml
vendored
@@ -1,87 +1,44 @@
|
|||||||
name: Create Release
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags-ignore:
|
|
||||||
- testing_*
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
Build:
|
||||||
runs-on: windows-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
- name: Setup .NET
|
|
||||||
uses: actions/setup-dotnet@v1
|
|
||||||
with:
|
|
||||||
dotnet-version: '9.x.x'
|
|
||||||
- name: Restore dependencies
|
|
||||||
run: dotnet restore
|
|
||||||
- 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: Build
|
|
||||||
run: |
|
|
||||||
$ver = '${{ github.ref_name }}'
|
|
||||||
invoke-expression 'dotnet build --no-restore --configuration Release --nologo -p:Version=$ver -p:FileVersion=$ver -p:AssemblyVersion=$ver'
|
|
||||||
- name: write version into jsons
|
|
||||||
run: |
|
|
||||||
$ver = '${{ github.ref_name }}'
|
|
||||||
$path = './CustomizePlus/bin/Release/CustomizePlus.json'
|
|
||||||
$json = Get-Content -Raw $path | ConvertFrom-Json
|
|
||||||
$json.AssemblyVersion = $ver
|
|
||||||
$content = $json | ConvertTo-Json
|
|
||||||
set-content -Path $path -Value $content
|
|
||||||
- name: Archive
|
|
||||||
run: Compress-Archive -Path CustomizePlus/bin/Release/* -DestinationPath CustomizePlus.zip
|
|
||||||
- name: Upload a Build Artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
./CustomizePlus/bin/Release/*
|
|
||||||
- name: Create Release
|
|
||||||
id: create_release
|
|
||||||
uses: actions/create-release@v1
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
DALAMUD_HOME: /tmp/dalamud
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up .NET
|
||||||
|
uses: actions/setup-dotnet@v3
|
||||||
|
with:
|
||||||
|
dotnet-version: 9.0.x
|
||||||
|
|
||||||
|
- name: Download Dalamud Latest
|
||||||
|
run: |
|
||||||
|
wget https://goatcorp.github.io/dalamud-distrib/latest.zip -O ${{ env.DALAMUD_HOME }}.zip
|
||||||
|
unzip ${{ env.DALAMUD_HOME }}.zip -d ${{ env.DALAMUD_HOME }}
|
||||||
|
|
||||||
|
- name: Restore Project
|
||||||
|
run: dotnet restore
|
||||||
|
|
||||||
|
- name: Build Project
|
||||||
|
run: dotnet build --configuration Release CustomizePlus/CustomizePlus.csproj -p:AssemblyVersion=${{ github.ref_name }}
|
||||||
|
|
||||||
|
- name: Create Release
|
||||||
|
uses: actions/create-release@v1
|
||||||
|
id: create_release
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ github.ref }}
|
|
||||||
release_name: CustomizePlus ${{ github.ref }}
|
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
- name: Upload Release Asset
|
release_name: ${{ github.ref_name }}
|
||||||
id: upload-release-asset
|
tag_name: ${{ github.ref_name }}
|
||||||
uses: actions/upload-release-asset@v1
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
|
|
||||||
asset_path: ./CustomizePlus.zip
|
|
||||||
asset_name: CustomizePlus.zip
|
|
||||||
asset_content_type: application/zip
|
|
||||||
|
|
||||||
- name: Write out repo.json
|
- name: Upload Release Asset with curl
|
||||||
run: |
|
run: |
|
||||||
$ver = '${{ github.ref_name }}'
|
curl \
|
||||||
$path = './repo.json'
|
-X POST \
|
||||||
$json = Get-Content -Raw $path | ConvertFrom-Json
|
-H "Authorization: token ${{ gitea.token }}" \
|
||||||
$json[0].AssemblyVersion = $ver
|
-H "Content-Type: application/zip" \
|
||||||
$json[0].TestingAssemblyVersion = $ver
|
--data-binary @CustomizePlus/bin/Release/CustomizePlus/latest.zip \
|
||||||
$json[0].DownloadLinkInstall = $json.DownloadLinkInstall -replace '[^/]+/CustomizePlus.zip',"$ver/CustomizePlus.zip"
|
"${{ steps.create_release.outputs.upload_url }}?name=latest.zip"
|
||||||
$json[0].DownloadLinkTesting = $json.DownloadLinkTesting -replace '[^/]+/CustomizePlus.zip',"$ver/CustomizePlus.zip"
|
|
||||||
$json[0].DownloadLinkUpdate = $json.DownloadLinkUpdate -replace '[^/]+/CustomizePlus.zip',"$ver/CustomizePlus.zip"
|
|
||||||
$content = $json | ConvertTo-Json -AsArray
|
|
||||||
set-content -Path $path -Value $content
|
|
||||||
|
|
||||||
- name: Commit repo.json
|
|
||||||
run: |
|
|
||||||
git config --global user.name "Actions User"
|
|
||||||
git config --global user.email "actions@github.com"
|
|
||||||
git fetch origin main
|
|
||||||
git branch -f main ${{ github.sha }}
|
|
||||||
git checkout main
|
|
||||||
git add repo.json
|
|
||||||
git commit -m "[CI] Updating repo.json for ${{ github.ref_name }}" || true
|
|
||||||
git push origin main
|
|
||||||
|
|||||||
85
.github/workflows/test_release.yml
vendored
85
.github/workflows/test_release.yml
vendored
@@ -1,85 +0,0 @@
|
|||||||
name: Create Test Release
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- testing_*
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: windows-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
- name: Setup .NET
|
|
||||||
uses: actions/setup-dotnet@v1
|
|
||||||
with:
|
|
||||||
dotnet-version: '9.x.x'
|
|
||||||
- name: Restore dependencies
|
|
||||||
run: dotnet restore
|
|
||||||
- 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: Build
|
|
||||||
run: |
|
|
||||||
$ver = '${{ github.ref_name }}' -replace 'testing_'
|
|
||||||
invoke-expression 'dotnet build --no-restore --configuration Release --nologo -p:Version=$ver -p:FileVersion=$ver -p:AssemblyVersion=$ver'
|
|
||||||
- name: write version into json
|
|
||||||
run: |
|
|
||||||
$ver = '${{ github.ref_name }}' -replace 'testing_'
|
|
||||||
$path = './CustomizePlus/bin/Release/CustomizePlus.json'
|
|
||||||
$json = Get-Content -Raw $path | ConvertFrom-Json
|
|
||||||
$json.AssemblyVersion = $ver
|
|
||||||
$content = $json | ConvertTo-Json
|
|
||||||
set-content -Path $path -Value $content
|
|
||||||
- name: Archive
|
|
||||||
run: Compress-Archive -Path CustomizePlus/bin/Release/* -DestinationPath CustomizePlus.zip
|
|
||||||
- name: Upload a Build Artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
./CustomizePlus/bin/Release/*
|
|
||||||
- name: Create Release
|
|
||||||
id: create_release
|
|
||||||
uses: actions/create-release@v1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
tag_name: ${{ github.ref }}
|
|
||||||
release_name: CustomizePlus ${{ github.ref }}
|
|
||||||
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 }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
|
|
||||||
asset_path: ./CustomizePlus.zip
|
|
||||||
asset_name: CustomizePlus.zip
|
|
||||||
asset_content_type: application/zip
|
|
||||||
|
|
||||||
- name: Write out repo.json
|
|
||||||
run: |
|
|
||||||
$verT = '${{ github.ref_name }}'
|
|
||||||
$ver = $verT -replace 'testing_'
|
|
||||||
$path = './repo.json'
|
|
||||||
$json = Get-Content -Raw $path | ConvertFrom-Json
|
|
||||||
$json[0].TestingAssemblyVersion = $ver
|
|
||||||
$json[0].DownloadLinkTesting = $json.DownloadLinkTesting -replace '[^/]+/CustomizePlus.zip',"$verT/CustomizePlus.zip"
|
|
||||||
$content = $json | ConvertTo-Json -AsArray
|
|
||||||
set-content -Path $path -Value $content
|
|
||||||
|
|
||||||
- name: Commit repo.json
|
|
||||||
run: |
|
|
||||||
git config --global user.name "Actions User"
|
|
||||||
git config --global user.email "actions@github.com"
|
|
||||||
git fetch origin main
|
|
||||||
git branch -f main ${{ github.sha }}
|
|
||||||
git checkout main
|
|
||||||
git add repo.json
|
|
||||||
git commit -m "[CI] Updating repo.json for ${{ github.ref_name }}" || true
|
|
||||||
git push origin main
|
|
||||||
Reference in New Issue
Block a user