87 lines
2.7 KiB
YAML
Raw Normal View History

2024-04-04 09:39:39 -04:00
name: 'Release Plugin'
2024-03-09 07:48:03 -05:00
on:
workflow_dispatch:
inputs:
version:
2024-03-21 13:22:12 -04:00
description: 'Version v'
2024-03-09 07:48:03 -05:00
required: true
type: string
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
2024-03-22 23:41:58 +01:00
dotnet-version: 8.0.x
2024-03-09 07:48:03 -05:00
- name: Restore dependencies
run: dotnet restore
- name: Embed version info
run: echo "${{ github.sha }}" > ConfusedPolarBear.Plugin.IntroSkipper/Configuration/version.txt
- name: Build
run: dotnet build --no-restore
- name: Upload artifact
uses: actions/upload-artifact@v4.3.1
with:
2024-03-21 13:22:12 -04:00
name: ConfusedPolarBear.Plugin.IntroSkipper-v${{ github.event.inputs.version }}.dll
2024-03-29 20:40:49 +01:00
path: ConfusedPolarBear.Plugin.IntroSkipper/bin/Debug/net8.0/ConfusedPolarBear.Plugin.IntroSkipper.dll
2024-03-09 07:48:03 -05:00
if-no-files-found: error
- name: Create archive
uses: vimtor/action-zip@v1.2
with:
files: |
2024-03-29 20:40:49 +01:00
ConfusedPolarBear.Plugin.IntroSkipper/bin/Debug/net8.0/ConfusedPolarBear.Plugin.IntroSkipper.dll
dest: intro-skipper-v${{ github.event.inputs.version }}.zip
2024-03-09 07:48:03 -05:00
2024-03-29 20:40:49 +01:00
- name: Generate manifest keys
2024-03-21 13:22:12 -04:00
run: |
2024-04-10 07:42:50 -04:00
sourceUrl="https://github.com/${{ github.repository }}/releases/download/10.9/v${{ github.event.inputs.version }}/intro-skipper-v${{ github.event.inputs.version }}.zip"
2024-03-29 20:40:49 +01:00
echo "SOURCE_URL=$sourceUrl" >> $GITHUB_ENV
md5sum intro-skipper-v${{ github.event.inputs.version }}.zip > intro-skipper-v${{ github.event.inputs.version }}.md5
checksum="$(awk '{print $1}' intro-skipper-v${{ github.event.inputs.version }}.md5)"
echo "CHECKSUM=$checksum" >> $GITHUB_ENV
timestamp="$(date +%FT%TZ)"
echo "TIMESTAMP=$timestamp" >> $GITHUB_ENV
2024-03-09 09:10:18 -05:00
2024-03-09 07:48:03 -05:00
- name: Publish release
uses: 8bitDream/action-github-releases@v1.0.0
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
2024-03-29 20:40:49 +01:00
automatic_release_tag: 10.9/v${{ github.event.inputs.version }}
2024-03-09 07:48:03 -05:00
prerelease: false
2024-03-21 13:22:12 -04:00
title: v${{ github.event.inputs.version }}
2024-03-09 07:48:03 -05:00
files: |
2024-03-21 13:22:12 -04:00
intro-skipper-v${{ github.event.inputs.version }}.zip
2024-03-29 20:40:49 +01:00
- name: Publish release notes
uses: softprops/action-gh-release@v2.0.4
with:
tag_name: 10.9/v${{ github.event.inputs.version }}
name: v${{ github.event.inputs.version }}
2024-03-31 15:54:54 -04:00
append_body: true
2024-03-29 20:40:49 +01:00
body: |
2024-03-31 15:54:54 -04:00
---
2024-04-04 09:39:39 -04:00
"targetAbi": "10.9.0.0",
"sourceUrl": "${{ env.SOURCE_URL }}",
"checksum": "${{ env.CHECKSUM }}",
"timestamp": "${{ env.TIMESTAMP }}"
2024-03-29 20:40:49 +01:00
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}