mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 10:17:22 +01:00
101 lines
No EOL
4.3 KiB
YAML
101 lines
No EOL
4.3 KiB
YAML
name: Create Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- '*'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: windows-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Setup .NET
|
|
uses: actions/setup-dotnet@v1
|
|
with:
|
|
dotnet-version: 5.0.100
|
|
- 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 }}' -replace 'refs/tags/',''
|
|
invoke-expression 'dotnet build --no-restore --configuration Release --nologo -p:Version=$ver -p:FileVersion=$ver'
|
|
- name: write version into json
|
|
run: |
|
|
$ver = '${{ github.ref }}' -replace 'refs/tags/',''
|
|
$path = './Penumbra/bin/Release/net5.0-windows/Penumbra.json'
|
|
$content = get-content -path $path
|
|
$content = $content -replace '1.0.0.0',$ver
|
|
set-content -Path $path -Value $content
|
|
- name: Archive
|
|
run: Compress-Archive -Path Penumbra/bin/Release/net5.0-windows/* -DestinationPath Penumbra.zip
|
|
- name: Upload a Build Artifact
|
|
uses: actions/upload-artifact@v2.2.1
|
|
with:
|
|
path: |
|
|
./Penumbra/bin/Release/net5.0-windows/*
|
|
- name: Create Release
|
|
id: create_release
|
|
uses: actions/create-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: ${{ github.ref }}
|
|
release_name: Penumbra ${{ 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: ./Penumbra.zip
|
|
asset_name: Penumbra.zip
|
|
asset_content_type: application/zip
|
|
|
|
- name: Write out repo.json
|
|
run: |
|
|
$ver = '${{ github.ref }}' -replace 'refs/tags/',''
|
|
|
|
$json = '[' + '\n'
|
|
$json += ' {' + '\n'
|
|
$json += ' "Author": "Adam",' + '\n'
|
|
$json += ' "Name": "Penumbra",' + '\n'
|
|
$json += ' "Description": "Runtime mod loader and manager.",' + '\n'
|
|
$json += ' "InternalName": "Penumbra",' + '\n'
|
|
$json += ' "AssemblyVersion": "1.0.0.0",' + '\n'
|
|
$json += ' "TestingAssemblyVersion": "1.0.0.0",' + '\n'
|
|
$json += ' "RepoUrl": "https://github.com/xivdev/Penumbra",' + '\n'
|
|
$json += ' "ApplicableVersion": "any",' + '\n'
|
|
$json += ' "DalamudApiLevel": 4,' + '\n'
|
|
$json += ' "IsHide": "False",' + '\n'
|
|
$json += ' "IsTestingExclusive": "False",' + '\n'
|
|
$json += ' "DownloadCount": 0,' + '\n'
|
|
$json += ' "LastUpdate": 0,' + '\n'
|
|
$json += ' "LoadPriority": 69420,' + '\n'
|
|
$json += ' "DownloadLinkInstall": "https://github.com/xivdev/Penumbra/releases/download/1.0.0.0/Penumbra.zip",' + '\n'
|
|
$json += ' "DownloadLinkTesting": "https://github.com/xivdev/Penumbra/releases/download/1.0.0.0/Penumbra.zip",' + '\n'
|
|
$json += ' "DownloadLinkUpdate": "https://github.com/xivdev/Penumbra/releases/download/1.0.0.0/Penumbra.zip",' + '\n'
|
|
$json += ' "IconUrl": "https://raw.githubusercontent.com/xivdev/Penumbra/master/images/icon.png"' + '\n'
|
|
$json += ' }' + '\n'
|
|
$json += ']' + '\n'
|
|
|
|
$json = $json -replace '1.0.0.0',$ver
|
|
set-content -Path "./repo.json" -Value $json
|
|
|
|
- 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 checkout master
|
|
git add repo.json
|
|
git commit -m "[CI] Updating repo.json for ${{ github.ref }}" || true
|
|
|
|
git push origin master || true |