name: 'Release Plugin' on: workflow_dispatch: permissions: contents: write jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Node.js uses: actions/setup-node@v4 with: node-version: '20' - name: Setup .NET uses: actions/setup-dotnet@v4 with: dotnet-version: 8.0.x - name: Restore dependencies run: dotnet restore - name: Run update version run: node update-version.js - 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.3 with: name: ConfusedPolarBear.Plugin.IntroSkipper-v${{ env.NEW_FILE_VERSION }}.dll path: ConfusedPolarBear.Plugin.IntroSkipper/bin/Debug/net8.0/ConfusedPolarBear.Plugin.IntroSkipper.dll if-no-files-found: error - 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 - name: Generate manifest keys run: | sourceUrl="https://github.com/${{ github.repository }}/releases/download/10.9/v${{ env.NEW_FILE_VERSION }}/intro-skipper-v${{ env.NEW_FILE_VERSION }}.zip" echo "SOURCE_URL=$sourceUrl" >> $GITHUB_ENV 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)" echo "CHECKSUM=$checksum" >> $GITHUB_ENV timestamp="$(date +%FT%TZ)" echo "TIMESTAMP=$timestamp" >> $GITHUB_ENV - 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 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Run validation and update script run: node validate-and-update-manifest.js env: 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" git add manifest.json ConfusedPolarBear.Plugin.IntroSkipper/ConfusedPolarBear.Plugin.IntroSkipper.csproj git commit -m "release v${{ env.NEW_FILE_VERSION }}" git push