2024-03-21 14:35:10 -04:00

84 lines
2.7 KiB
YAML

name: 'Release Plugin'
on:
workflow_dispatch:
inputs:
version:
description: 'Version v'
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:
dotnet-version: 6.0.x
- 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:
name: ConfusedPolarBear.Plugin.IntroSkipper-v${{ github.event.inputs.version }}.dll
path: ConfusedPolarBear.Plugin.IntroSkipper/bin/Debug/net6.0/ConfusedPolarBear.Plugin.IntroSkipper.dll
if-no-files-found: error
- name: Create archive
uses: vimtor/action-zip@v1.2
with:
files: |
ConfusedPolarBear.Plugin.IntroSkipper/bin/Debug/net6.0/ConfusedPolarBear.Plugin.IntroSkipper.dll
dest: intro-skipper-v${{ github.event.inputs.version }}.zip
- name: Generate md5
run: |
md5sum intro-skipper-v${{ github.event.inputs.version }}.zip > intro-skipper-v${{ github.event.inputs.version }}.md5
GIT_MD5SUM=$(awk '{print $1}' intro-skipper-v${{ github.event.inputs.version }}.md5)
echo "GIT_MD5SUM=${GIT_MD5SUM}" >> $GITHUB_ENV
echo "MD5: ${{ env.GIT_MD5SUM }}"
- name: Publish release
uses: 8bitDream/action-github-releases@v1.0.0
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: v${{ github.event.inputs.version }}
prerelease: false
title: v${{ github.event.inputs.version }}
files: |
intro-skipper-v${{ github.event.inputs.version }}.md5
intro-skipper-v${{ github.event.inputs.version }}.zip
#
# - name: Update manifest
#
# {
# "version": "${{ github.event.inputs.version }}",
# "changelog": "- See the full changelog at [GitHub](https://github.com/jumoog/intro-skipper/blob/master/CHANGELOG.md)\n",
# "targetAbi": "10.8.4.0",
# "sourceUrl": "https://github.com/jumoog/intro-skipper/releases/download/v${{ github.event.inputs.version }}/intro-skipper-v${{ github.event.inputs.version }}.zip",
# "checksum": "${{ env.GIT_MD5SUM }}",
# "timestamp": "2024-03-11T22:00:13Z"
# },
# - name: Push changes
# uses: ad-m/github-push-action@master
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# branch: master