replace most GitHub Actions with build functions

This commit is contained in:
Kilian von Pflugk 2024-05-27 19:33:51 +02:00
parent b06ab6e41f
commit 977913ffc8
2 changed files with 21 additions and 50 deletions

View File

@ -68,12 +68,8 @@ jobs:
if-no-files-found: error if-no-files-found: error
- name: Create archive - name: Create archive
uses: vimtor/action-zip@v1.2
if: github.event_name != 'pull_request' if: github.event_name != 'pull_request'
with: run: zip -j "intro-skipper-${{ env.GIT_HASH }}.zip" ConfusedPolarBear.Plugin.IntroSkipper/bin/Debug/net8.0/ConfusedPolarBear.Plugin.IntroSkipper.dll
files: |
ConfusedPolarBear.Plugin.IntroSkipper/bin/Debug/net8.0/ConfusedPolarBear.Plugin.IntroSkipper.dll
dest: intro-skipper-${{ env.GIT_HASH }}.zip
- name: Generate md5 - name: Generate md5
if: github.event_name != 'pull_request' if: github.event_name != 'pull_request'
@ -82,28 +78,21 @@ jobs:
checksum="$(awk '{print $1}' intro-skipper-${{ env.GIT_HASH }}.md5)" checksum="$(awk '{print $1}' intro-skipper-${{ env.GIT_HASH }}.md5)"
echo "CHECKSUM=$checksum" >> $GITHUB_ENV echo "CHECKSUM=$checksum" >> $GITHUB_ENV
- name: Publish prerelease - name: Check if prerelease with tag '10.9/preview' exists and delete it
uses: 8bitDream/action-github-releases@v1.0.0
if: github.event_name != 'pull_request' if: github.event_name != 'pull_request'
with: run: |
repo_token: "${{ secrets.GITHUB_TOKEN }}" if gh release view 10.9/preview --json id 2>/dev/null; then
automatic_release_tag: 10.9/preview release_id=$(gh release view 10.9/preview --json id -q ".id")
prerelease: true echo "Deleting existing prerelease with id: $release_id"
title: intro-skipper-${{ env.GIT_HASH }} gh release delete 10.9/preview -y
files: | else
intro-skipper-${{ env.GIT_HASH }}.zip echo "No existing prerelease with tag '10.9/preview' found."
fi
- name: Publish prerelease notes env:
uses: softprops/action-gh-release@v2.0.5 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: github.event_name != 'pull_request'
with: - name: Create new prerelease with tag '10.9/preview'
tag_name: 10.9/preview if: github.event_name != 'pull_request'
name: intro-skipper-${{ env.GIT_HASH }} run: 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."
append_body: true
body: |
---
checksum: ${{ env.CHECKSUM }}
draft: false
prerelease: true
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -44,12 +44,8 @@ jobs:
if-no-files-found: error if-no-files-found: error
- name: Create archive - name: Create archive
uses: vimtor/action-zip@v1.2 run: zip -j "intro-skipper-v${{ env.NEW_FILE_VERSION }}.zip" ConfusedPolarBear.Plugin.IntroSkipper/bin/Debug/net8.0/ConfusedPolarBear.Plugin.IntroSkipper.dll
with:
files: |
ConfusedPolarBear.Plugin.IntroSkipper/bin/Debug/net8.0/ConfusedPolarBear.Plugin.IntroSkipper.dll
dest: intro-skipper-v${{ env.NEW_FILE_VERSION }}.zip
- name: Generate manifest keys - name: Generate manifest keys
run: | run: |
sourceUrl="https://github.com/${{ github.repository }}/releases/download/10.9/v${{ env.NEW_FILE_VERSION }}/intro-skipper-v${{ env.NEW_FILE_VERSION }}.zip" sourceUrl="https://github.com/${{ github.repository }}/releases/download/10.9/v${{ env.NEW_FILE_VERSION }}/intro-skipper-v${{ env.NEW_FILE_VERSION }}.zip"
@ -60,23 +56,9 @@ jobs:
timestamp="$(date +%FT%TZ)" timestamp="$(date +%FT%TZ)"
echo "TIMESTAMP=$timestamp" >> $GITHUB_ENV echo "TIMESTAMP=$timestamp" >> $GITHUB_ENV
- name: Publish release - name: Create new release with tag
uses: 8bitDream/action-github-releases@v1.0.0 if: github.event_name != 'pull_request'
with: 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
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: 10.9/v${{ env.NEW_FILE_VERSION }}
prerelease: false
title: v${{ env.NEW_FILE_VERSION }}
files: |
intro-skipper-v${{ env.NEW_FILE_VERSION }}.zip
- name: Publish release notes
uses: softprops/action-gh-release@v2.0.5
with:
tag_name: 10.9/v${{ env.NEW_FILE_VERSION }}
name: v${{ env.NEW_FILE_VERSION }}
draft: false
prerelease: false
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}