64 lines
1.7 KiB
YAML
Raw Normal View History

2022-06-10 16:14:09 -05:00
name: 'Build Plugin'
2022-06-10 16:19:07 -05:00
on:
push:
2024-03-09 07:48:03 -05:00
branches: [ "master" ]
2022-06-10 16:19:07 -05:00
pull_request:
branches: [ "master" ]
2024-03-01 11:40:05 -05:00
permissions:
contents: write
2022-06-10 16:19:07 -05:00
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
2022-06-10 16:25:44 -05:00
2022-06-10 16:19:07 -05:00
- name: Setup .NET
uses: actions/setup-dotnet@v4
2022-06-10 16:19:07 -05:00
with:
dotnet-version: 6.0.x
2022-06-10 16:25:44 -05:00
2022-06-10 16:19:07 -05:00
- name: Restore dependencies
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
2022-06-10 16:47:46 -05:00
- name: Upload artifact
uses: actions/upload-artifact@v4.3.1
2022-06-10 16:47:46 -05:00
with:
name: ConfusedPolarBear.Plugin.IntroSkipper-${{ env.GIT_HASH }}.dll
2022-06-10 16:47:46 -05:00
path: ConfusedPolarBear.Plugin.IntroSkipper/bin/Debug/net6.0/ConfusedPolarBear.Plugin.IntroSkipper.dll
if-no-files-found: error
2024-03-01 11:40:05 -05:00
- name: Create archive
uses: vimtor/action-zip@v1.2
2024-03-02 21:05:57 -05:00
if: github.event_name != 'pull_request'
2024-03-01 11:40:05 -05:00
with:
2024-03-06 19:10:57 -05:00
files: |
2024-03-07 21:17:02 -05:00
ConfusedPolarBear.Plugin.IntroSkipper/bin/Debug/net6.0/ConfusedPolarBear.Plugin.IntroSkipper.dll
2024-03-01 11:40:05 -05:00
dest: intro-skipper-${{ env.GIT_HASH }}.zip
- name: Publish prerelease
uses: 8bitDream/action-github-releases@v1.0.0
if: github.event_name != 'pull_request'
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
2024-03-01 13:27:09 -05:00
automatic_release_tag: preview
2024-03-01 11:40:05 -05:00
prerelease: true
title: intro-skipper-${{ env.GIT_HASH }}
files: |
intro-skipper-${{ env.GIT_HASH }}.zip