71 lines
2.3 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:
node-version: '20'
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
run: zip -j "intro-skipper-v${{ env.NEW_FILE_VERSION }}.zip" ConfusedPolarBear.Plugin.IntroSkipper/bin/Debug/net8.0/ConfusedPolarBear.Plugin.IntroSkipper.dll
2024-03-29 20:40:49 +01:00
- name: Generate manifest keys
2024-03-21 13:22:12 -04:00
run: |
2024-05-26 01:23:38 +02:00
sourceUrl="https://github.com/${{ github.repository }}/releases/download/10.9/v${{ env.NEW_FILE_VERSION }}/intro-skipper-v${{ env.NEW_FILE_VERSION }}.zip"
2024-03-29 20:40:49 +01:00
echo "SOURCE_URL=$sourceUrl" >> $GITHUB_ENV
2024-05-26 01:23:38 +02:00
md5sum intro-skipper-v${{ env.NEW_FILE_VERSION }}.zip > intro-skipper-v${{ env.NEW_FILE_VERSION }}.md5
checksum="$(awk '{print $1}' intro-skipper-v${{ env.NEW_FILE_VERSION }}.md5)"
2024-03-29 20:40:49 +01:00
echo "CHECKSUM=$checksum" >> $GITHUB_ENV
timestamp="$(date +%FT%TZ)"
echo "TIMESTAMP=$timestamp" >> $GITHUB_ENV
2024-03-09 09:10:18 -05: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 }}
- 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 }}
- 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-05-19 13:17:08 +02:00
git add 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