63 lines
1.8 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:
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
2024-09-02 20:46:48 +02:00
run: dotnet build --configuration Release --no-restore
2024-03-09 07:48:03 -05:00
- name: Create archive
2024-09-02 20:46:48 +02:00
run: zip -j "intro-skipper-v${{ env.NEW_FILE_VERSION }}.zip" ConfusedPolarBear.Plugin.IntroSkipper/bin/Release/net8.0/ConfusedPolarBear.Plugin.IntroSkipper.dll
2024-03-09 09:10:18 -05:00
- name: Create new release with tag
if: github.event_name != 'pull_request'
2024-08-27 20:58:55 +02:00
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 --generate-notes
2024-03-29 20:40:49 +01:00
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- 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 }}
GITHUB_REPOSITORY: ${{ github.repository }}
- 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"
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 }}"
git push