2022-06-10 16:14:09 -05:00
|
|
|
name: 'Build Plugin'
|
2022-06-10 16:19:07 -05:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2024-04-09 22:08:39 -04:00
|
|
|
branches: [ "master" ]
|
2024-04-19 21:41:03 -04:00
|
|
|
paths-ignore:
|
|
|
|
- '**/README.md'
|
|
|
|
- '.github/ISSUE_TEMPLATE/**'
|
|
|
|
- 'docs/**'
|
|
|
|
- 'images/**'
|
|
|
|
- 'manifest.json'
|
2022-06-10 16:19:07 -05:00
|
|
|
pull_request:
|
2024-04-09 22:08:39 -04:00
|
|
|
branches: [ "master" ]
|
2024-04-19 21:41:03 -04:00
|
|
|
paths-ignore:
|
|
|
|
- '**/README.md'
|
|
|
|
- '.github/ISSUE_TEMPLATE/**'
|
|
|
|
- 'docs/**'
|
|
|
|
- 'images/**'
|
|
|
|
- 'manifest.json'
|
2022-06-10 16:19:07 -05:00
|
|
|
|
2024-03-01 11:40:05 -05:00
|
|
|
permissions:
|
|
|
|
contents: write
|
2024-03-29 20:40:49 +01:00
|
|
|
packages: write
|
2024-03-01 11:40:05 -05:00
|
|
|
|
2022-06-10 16:19:07 -05:00
|
|
|
jobs:
|
|
|
|
build:
|
2024-04-10 07:26:03 -04:00
|
|
|
if: ${{ ! startsWith(github.event.head_commit.message, 'v0.') }}
|
2022-06-10 16:19:07 -05:00
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2023-10-02 13:10:41 +00:00
|
|
|
- uses: actions/checkout@v4
|
2022-06-10 16:25:44 -05:00
|
|
|
|
2022-06-10 16:19:07 -05:00
|
|
|
- name: Setup .NET
|
2024-01-01 15:04:34 +00:00
|
|
|
uses: actions/setup-dotnet@v4
|
2022-06-10 16:19:07 -05:00
|
|
|
with:
|
2024-03-22 23:41:58 +01:00
|
|
|
dotnet-version: 8.0.x
|
2024-05-16 05:46:23 -04:00
|
|
|
|
2022-06-10 16:19:07 -05:00
|
|
|
- name: Restore dependencies
|
2024-05-11 20:11:25 +00:00
|
|
|
run: dotnet restore
|
2022-06-10 16:25:44 -05:00
|
|
|
|
2022-06-12 16:57:15 -05:00
|
|
|
- name: Embed version info
|
|
|
|
run: echo "${{ github.sha }}" > ConfusedPolarBear.Plugin.IntroSkipper/Configuration/version.txt
|
|
|
|
|
2024-03-01 11:40:05 -05:00
|
|
|
- name: Retrieve commit identification
|
|
|
|
run: |
|
|
|
|
GIT_HASH=$(git rev-parse --short HEAD)
|
|
|
|
echo "GIT_HASH=${GIT_HASH}" >> $GITHUB_ENV
|
|
|
|
|
2022-06-10 16:19:07 -05:00
|
|
|
- name: Build
|
|
|
|
run: dotnet build --no-restore
|
2022-06-10 23:08:27 -05:00
|
|
|
|
2024-05-16 05:46:23 -04:00
|
|
|
|
2024-03-01 11:40:05 -05:00
|
|
|
- name: Create archive
|
2024-03-02 21:05:57 -05:00
|
|
|
if: github.event_name != 'pull_request'
|
2024-05-27 19:33:51 +02:00
|
|
|
run: zip -j "intro-skipper-${{ env.GIT_HASH }}.zip" ConfusedPolarBear.Plugin.IntroSkipper/bin/Debug/net8.0/ConfusedPolarBear.Plugin.IntroSkipper.dll
|
2024-03-01 11:40:05 -05:00
|
|
|
|
2024-05-27 19:46:45 +02:00
|
|
|
- name: Create/replace the preview release and upload artifacts
|
2024-03-01 11:40:05 -05:00
|
|
|
if: github.event_name != 'pull_request'
|
2024-05-27 19:33:51 +02:00
|
|
|
run: |
|
2024-05-27 19:46:45 +02:00
|
|
|
gh release delete '10.9/preview' --cleanup-tag --yes || true
|
|
|
|
gh release create '10.9/preview' "intro-skipper-${{ env.GIT_HASH }}.zip" --prerelease --title "intro-skipper-${{ env.GIT_HASH }}" --notes "This is a prerelease version."
|
2024-05-27 19:33:51 +02:00
|
|
|
env:
|
2024-05-27 19:46:45 +02:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|