2024-04-04 09:39:39 -04:00
|
|
|
name: 'Release Plugin'
|
2024-03-09 07:48:03 -05:00
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
|
2024-05-19 13:17:08 +02:00
|
|
|
- name: Set up Node.js
|
|
|
|
uses: actions/setup-node@v4
|
|
|
|
with:
|
2024-08-15 19:48:12 +02:00
|
|
|
node-version: 'lts/*'
|
2024-05-19 13:17:08 +02:00
|
|
|
|
2024-03-09 07:48:03 -05:00
|
|
|
- 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
|
2024-05-11 20:09:29 +00:00
|
|
|
run: dotnet restore
|
2024-03-09 07:48:03 -05:00
|
|
|
|
2024-05-19 13:17:08 +02:00
|
|
|
- name: Run update version
|
|
|
|
run: node update-version.js
|
|
|
|
|
2024-03-09 07:48:03 -05:00
|
|
|
- name: Embed version info
|
|
|
|
run: echo "${{ github.sha }}" > ConfusedPolarBear.Plugin.IntroSkipper/Configuration/version.txt
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: dotnet build --no-restore
|
|
|
|
|
|
|
|
- name: Create archive
|
2024-05-27 19:33:51 +02:00
|
|
|
run: zip -j "intro-skipper-v${{ env.NEW_FILE_VERSION }}.zip" ConfusedPolarBear.Plugin.IntroSkipper/bin/Debug/net8.0/ConfusedPolarBear.Plugin.IntroSkipper.dll
|
|
|
|
|
2024-03-09 09:10:18 -05:00
|
|
|
|
2024-05-27 19:33:51 +02:00
|
|
|
- name: Create new release with tag
|
|
|
|
if: github.event_name != 'pull_request'
|
|
|
|
run: gh release create "10.9/v${{ env.NEW_FILE_VERSION }}" "intro-skipper-v${{ env.NEW_FILE_VERSION }}.zip" --title "v${{ env.NEW_FILE_VERSION }}" --latest
|
2024-03-29 20:40:49 +01:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
2024-05-19 00:57:11 +02:00
|
|
|
- name: Run validation and update script
|
|
|
|
run: node validate-and-update-manifest.js
|
|
|
|
env:
|
2024-05-26 01:23:38 +02:00
|
|
|
VERSION: ${{ env.NEW_FILE_VERSION }}
|
2024-08-15 20:36:35 +02:00
|
|
|
GITHUB_REPOSITORY: ${{ github.repository }}
|
2024-05-19 00:57:11 +02:00
|
|
|
|
|
|
|
- name: Commit changes
|
|
|
|
if: success()
|
|
|
|
run: |
|
|
|
|
git config --global user.name "github-actions[bot]"
|
|
|
|
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
2024-08-15 23:53:41 +02:00
|
|
|
git add README.md manifest.json ConfusedPolarBear.Plugin.IntroSkipper/ConfusedPolarBear.Plugin.IntroSkipper.csproj
|
2024-05-26 01:23:38 +02:00
|
|
|
git commit -m "release v${{ env.NEW_FILE_VERSION }}"
|
2024-05-19 00:57:11 +02:00
|
|
|
git push
|