mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-12 18:27:24 +01:00
Try workflows.
This commit is contained in:
parent
c35790cdac
commit
3c2937187b
4 changed files with 175 additions and 3 deletions
87
.github/workflows/release.yml
vendored
Normal file
87
.github/workflows/release.yml
vendored
Normal file
|
|
@ -0,0 +1,87 @@
|
||||||
|
name: Create Testing Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags-ignore:
|
||||||
|
- testing_*
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
- name: Setup .NET
|
||||||
|
uses: actions/setup-dotnet@v1
|
||||||
|
with:
|
||||||
|
dotnet-version: '7.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 = './Glamourer/bin/Release/Glamourer.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 Glamourer/bin/Release/* -DestinationPath Glamourer.zip
|
||||||
|
- name: Upload a Build Artifact
|
||||||
|
uses: actions/upload-artifact@v2.2.1
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
./Glamourer/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: Glamourer ${{ 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: ./Glamourer.zip
|
||||||
|
asset_name: Glamourer.zip
|
||||||
|
asset_content_type: application/zip
|
||||||
|
|
||||||
|
- name: Write out repo.json
|
||||||
|
run: |
|
||||||
|
$ver = '${{ github.ref_name }}'
|
||||||
|
$path = './repo.json'
|
||||||
|
$json = Get-Content -Raw $path | ConvertFrom-Json
|
||||||
|
$json[0].AssemblyVersion = $ver
|
||||||
|
$json[0].TestingAssemblyVersion = $ver
|
||||||
|
$json[0].DownloadLinkInstall = $json.DownloadLinkInstall -replace '[^/]+/Glamourer.zip',"$ver/Glamourer.zip"
|
||||||
|
$json[0].DownloadLinkTesting = $json.DownloadLinkTesting -replace '[^/]+/Glamourer.zip',"$ver/Glamourer.zip"
|
||||||
|
$json[0].DownloadLinkUpdate = $json.DownloadLinkUpdate -replace '[^/]+/Glamourer.zip',"$ver/Glamourer.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 master
|
||||||
|
git branch -f master ${{ github.sha }}
|
||||||
|
git checkout master
|
||||||
|
git add repo.json
|
||||||
|
git commit -m "[CI] Updating repo.json for ${{ github.ref_name }}" || true
|
||||||
|
git push origin master
|
||||||
85
.github/workflows/test_release.yml
vendored
Normal file
85
.github/workflows/test_release.yml
vendored
Normal file
|
|
@ -0,0 +1,85 @@
|
||||||
|
name: Create Test Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- testing_*
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
- name: Setup .NET
|
||||||
|
uses: actions/setup-dotnet@v1
|
||||||
|
with:
|
||||||
|
dotnet-version: '7.x.x'
|
||||||
|
- name: Restore dependencies
|
||||||
|
run: dotnet restore
|
||||||
|
- name: Download Dalamud
|
||||||
|
run: |
|
||||||
|
Invoke-WebRequest -Uri https://goatcorp.github.io/dalamud-distrib/stg/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 Debug --nologo -p:Version=$ver -p:FileVersion=$ver -p:AssemblyVersion=$ver'
|
||||||
|
- name: write version into json
|
||||||
|
run: |
|
||||||
|
$ver = '${{ github.ref_name }}' -replace 'testing_'
|
||||||
|
$path = './Glamourer/bin/Debug/Glamourer.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 Glamourer/bin/Debug/* -DestinationPath Glamourer.zip
|
||||||
|
- name: Upload a Build Artifact
|
||||||
|
uses: actions/upload-artifact@v2.2.1
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
./Glamourer/bin/Debug/*
|
||||||
|
- name: Create Release
|
||||||
|
id: create_release
|
||||||
|
uses: actions/create-release@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
tag_name: ${{ github.ref }}
|
||||||
|
release_name: Glamourer ${{ 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: ./Glamourer.zip
|
||||||
|
asset_name: Glamourer.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 '[^/]+/Glamourer.zip',"$verT/Glamourer.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 master
|
||||||
|
git branch -f master ${{ github.sha }}
|
||||||
|
git checkout master
|
||||||
|
git add repo.json
|
||||||
|
git commit -m "[CI] Updating repo.json for ${{ github.ref_name }}" || true
|
||||||
|
git push origin master
|
||||||
BIN
Glamourer.zip
BIN
Glamourer.zip
Binary file not shown.
|
|
@ -15,9 +15,9 @@
|
||||||
"IsTestingExclusive": "False",
|
"IsTestingExclusive": "False",
|
||||||
"DownloadCount": 1,
|
"DownloadCount": 1,
|
||||||
"LastUpdate": 1618608322,
|
"LastUpdate": 1618608322,
|
||||||
"DownloadLinkInstall": "https://github.com/Ottermandias/Glamourer/raw/main/Glamourer.zip",
|
"DownloadLinkInstall": "https://github.com/Ottermandias/Glamourer/releases/download/1.0.0.2/Glamourer.zip",
|
||||||
"DownloadLinkUpdate": "https://github.com/Ottermandias/Glamourer/raw/main/Glamourer.zip",
|
"DownloadLinkUpdate": "https://github.com/Ottermandias/Glamourer/releases/download/1.0.0.2/Glamourer.zip",
|
||||||
"DownloadLinkTesting": "https://github.com/Ottermandias/Glamourer/raw/main/Glamourer.zip",
|
"DownloadLinkTesting": "https://github.com/Ottermandias/Glamourer/releases/download/1.0.0.2/Glamourer.zip",
|
||||||
"IconUrl": "https://raw.githubusercontent.com/Ottermandias/Glamourer/main/images/icon.png"
|
"IconUrl": "https://raw.githubusercontent.com/Ottermandias/Glamourer/main/images/icon.png"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue