mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 10:17:22 +01:00
Try revamping release actions.
This commit is contained in:
parent
381ab4befe
commit
2bc8092cca
2 changed files with 36 additions and 38 deletions
37
.github/workflows/release.yml
vendored
37
.github/workflows/release.yml
vendored
|
|
@ -24,14 +24,15 @@ jobs:
|
||||||
Expand-Archive -Force latest.zip "$env:AppData\XIVLauncher\addon\Hooks\dev"
|
Expand-Archive -Force latest.zip "$env:AppData\XIVLauncher\addon\Hooks\dev"
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
$ver = '${{ github.ref }}' -replace 'refs/tags/',''
|
$ver = '${{ github.ref_name }}'
|
||||||
invoke-expression 'dotnet build --no-restore --configuration Release --nologo -p:Version=$ver -p:FileVersion=$ver -p:AssemblyVersion=$ver'
|
invoke-expression 'dotnet build --no-restore --configuration Release --nologo -p:Version=$ver -p:FileVersion=$ver -p:AssemblyVersion=$ver'
|
||||||
- name: write version into json
|
- name: write version into jsons
|
||||||
run: |
|
run: |
|
||||||
$ver = '${{ github.ref }}' -replace 'refs/tags/',''
|
$ver = '${{ github.ref_name }}'
|
||||||
$path = './Penumbra/bin/Release/Penumbra.json'
|
$path = './Penumbra/bin/Release/Penumbra.json'
|
||||||
$content = get-content -path $path
|
$json = Get-Content -Raw $path | ConvertFrom-Json
|
||||||
$content = $content -replace '1.0.0.0',$ver
|
$json.AssemblyVersion = $ver
|
||||||
|
$content = $json | ConvertTo-Json
|
||||||
set-content -Path $path -Value $content
|
set-content -Path $path -Value $content
|
||||||
- name: Archive
|
- name: Archive
|
||||||
run: Compress-Archive -Path Penumbra/bin/Release/* -DestinationPath Penumbra.zip
|
run: Compress-Archive -Path Penumbra/bin/Release/* -DestinationPath Penumbra.zip
|
||||||
|
|
@ -63,26 +64,24 @@ jobs:
|
||||||
|
|
||||||
- name: Write out repo.json
|
- name: Write out repo.json
|
||||||
run: |
|
run: |
|
||||||
$ver = '${{ github.ref }}' -replace 'refs/tags/',''
|
$ver = '${{ github.ref_name }}'
|
||||||
$path = './base_repo.json'
|
$path = './repo.json'
|
||||||
$new_path = './repo.json'
|
$json = Get-Content -Raw $path | ConvertFrom-Json
|
||||||
$content = get-content -path $path
|
$json[0].AssemblyVersion = $ver
|
||||||
$content = $content -replace '1.0.0.0',$ver
|
$json[0].TestingAssemblyVersion = $ver
|
||||||
set-content -Path $new_path -Value $content
|
$json[0].DownloadLinkInstall = $json.DownloadLinkInstall -replace '[^/]+/Penumbra.zip',"$ver/Penumbra.zip"
|
||||||
|
$json[0].DownloadLinkTesting = $json.DownloadLinkTesting -replace '[^/]+/Penumbra.zip',"$ver/Penumbra.zip"
|
||||||
|
$json[0].DownloadLinkUpdate = $json.DownloadLinkUpdate -replace '[^/]+/Penumbra.zip',"$ver/Penumbra.zip"
|
||||||
|
$content = $json | ConvertTo-Json
|
||||||
|
set-content -Path $path -Value $content
|
||||||
|
|
||||||
- name: Commit repo.json
|
- name: Commit repo.json
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name "Actions User"
|
git config --global user.name "Actions User"
|
||||||
git config --global user.email "actions@github.com"
|
git config --global user.email "actions@github.com"
|
||||||
|
|
||||||
git fetch origin master
|
git fetch origin master
|
||||||
git fetch origin test
|
git branch -f master ${{ github.sha }}
|
||||||
git branch -f test ${{ github.sha }}
|
|
||||||
git checkout master
|
git checkout master
|
||||||
git add repo.json
|
git add repo.json
|
||||||
git commit -m "[CI] Updating repo.json for ${{ github.ref }}" || true
|
git commit -m "[CI] Updating repo.json for ${{ github.ref_name }}" || true
|
||||||
|
|
||||||
git push origin master
|
git push origin master
|
||||||
git branch -f test origin/master
|
|
||||||
git checkout test
|
|
||||||
git push origin test -f || true
|
|
||||||
|
|
|
||||||
37
.github/workflows/test_release.yml
vendored
37
.github/workflows/test_release.yml
vendored
|
|
@ -24,14 +24,15 @@ jobs:
|
||||||
Expand-Archive -Force latest.zip "$env:AppData\XIVLauncher\addon\Hooks\dev"
|
Expand-Archive -Force latest.zip "$env:AppData\XIVLauncher\addon\Hooks\dev"
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
$ver = '${{ github.ref }}' -replace 'refs/tags/t',''
|
$ver = '${{ github.ref_name }}' -replace 't'
|
||||||
invoke-expression 'dotnet build --no-restore --configuration Debug --nologo -p:Version=$ver -p:FileVersion=$ver -p:AssemblyVersion=$ver'
|
invoke-expression 'dotnet build --no-restore --configuration Debug --nologo -p:Version=$ver -p:FileVersion=$ver -p:AssemblyVersion=$ver'
|
||||||
- name: write version into json
|
- name: write version into json
|
||||||
run: |
|
run: |
|
||||||
$ver = '${{ github.ref }}' -replace 'refs/tags/t',''
|
$ver = '${{ github.ref_name }}' -replace 't'
|
||||||
$path = './Penumbra/bin/Debug/Penumbra.json'
|
$path = './Penumbra/bin/Debug/Penumbra.json'
|
||||||
$content = get-content -path $path
|
$json = Get-Content -Raw $path | ConvertFrom-Json
|
||||||
$content = $content -replace '1.0.0.0',$ver
|
$json.AssemblyVersion = $ver
|
||||||
|
$content = $json | ConvertTo-Json
|
||||||
set-content -Path $path -Value $content
|
set-content -Path $path -Value $content
|
||||||
- name: Archive
|
- name: Archive
|
||||||
run: Compress-Archive -Path Penumbra/bin/Debug/* -DestinationPath Penumbra.zip
|
run: Compress-Archive -Path Penumbra/bin/Debug/* -DestinationPath Penumbra.zip
|
||||||
|
|
@ -63,24 +64,22 @@ jobs:
|
||||||
|
|
||||||
- name: Write out repo.json
|
- name: Write out repo.json
|
||||||
run: |
|
run: |
|
||||||
$ver = '${{ github.ref }}' -replace 'refs/tags/t',''
|
$verT = '${{ github.ref_name }}'
|
||||||
$ver2 = '${{ github.ref }}' -replace 'refs/tags/',''
|
$ver = $verT -replace 't'
|
||||||
$path = './base_repo.json'
|
$path = './repo.json'
|
||||||
$new_path = './repo.json'
|
$json = Get-Content -Raw $path | ConvertFrom-Json
|
||||||
$content = get-content -path $path
|
$json[0].TestingAssemblyVersion = $ver
|
||||||
$content = $content -replace '/1.0.0.0/',"/$ver2/"
|
$json[0].DownloadLinkTesting = $json.DownloadLinkTesting -replace '[^/]+/Penumbra.zip',"$verT/Penumbra.zip"
|
||||||
$content = $content -replace '1.0.0.0',$ver
|
$content = $json | ConvertTo-Json
|
||||||
set-content -Path $new_path -Value $content
|
set-content -Path $path -Value $content
|
||||||
|
|
||||||
- name: Commit repo.json
|
- name: Commit repo.json
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name "Actions User"
|
git config --global user.name "Actions User"
|
||||||
git config --global user.email "actions@github.com"
|
git config --global user.email "actions@github.com"
|
||||||
|
git fetch origin master
|
||||||
git fetch origin test
|
git branch -f master ${{ github.sha }}
|
||||||
git branch -f test ${{ github.sha }}
|
git checkout master
|
||||||
git checkout test
|
|
||||||
git add repo.json
|
git add repo.json
|
||||||
git commit -m "[CI] Updating repo.json for ${{ github.ref }}" || true
|
git commit -m "[CI] Updating repo.json for ${{ github.ref_name }}" || true
|
||||||
|
git push origin master
|
||||||
git push origin test -f || true
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue