Add an action to build release
This commit is contained in:
parent
dc963892f4
commit
fbb80159de
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@ -2,7 +2,7 @@ name: 'Build Plugin'
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "master", "analyzers" ]
|
||||
branches: [ "master" ]
|
||||
pull_request:
|
||||
branches: [ "master" ]
|
||||
|
||||
|
58
.github/workflows/release.yml
vendored
Normal file
58
.github/workflows/release.yml
vendored
Normal file
@ -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
|
Loading…
x
Reference in New Issue
Block a user