diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d413d4a..485fadc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,7 @@ name: 'Build Plugin' on: push: - branches: [ "master", "analyzers" ] + branches: [ "master" ] pull_request: branches: [ "master" ] diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f59a289 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,58 @@ +name: 'Build Plugin' + +on: + workflow_dispatch: + inputs: + version: + description: 'v0.1' + required: true + type: string + +permissions: + contents: write + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 6.0.x + + - name: Restore dependencies + run: dotnet restore + + - 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.1 + with: + name: ConfusedPolarBear.Plugin.IntroSkipper-${{ github.event.head_commit.message }}.dll + path: ConfusedPolarBear.Plugin.IntroSkipper/bin/Debug/net6.0/ConfusedPolarBear.Plugin.IntroSkipper.dll + if-no-files-found: error + + - name: Create archive + uses: vimtor/action-zip@v1.2 + with: + files: | + ConfusedPolarBear.Plugin.IntroSkipper/bin/Debug/net6.0/ConfusedPolarBear.Plugin.IntroSkipper.dll + dest: intro-skipper-${{ github.event.head_commit.message }}.zip + + - name: Publish release + uses: 8bitDream/action-github-releases@v1.0.0 + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + automatic_release_tag: ${{ github.event.head_commit.message }} + prerelease: false + title: intro-skipper-${{ github.event.head_commit.message }} + files: | + intro-skipper-${{ github.event.head_commit.message }}.zip