Skip to content

QoL Improvements (#654) #161

QoL Improvements (#654)

QoL Improvements (#654) #161

name: Release-Dev-Auto
on:
push:
branches: master
jobs:
release-dev-auto:
runs-on: ubuntu-latest
environment: production
name: Build & release dev version
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js v18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Setup pnpm and install dependencies
uses: pnpm/action-setup@v2
with:
version: 8
run_install: true
- name: Lint
run: pnpm lint --quiet
- name: Get new version
uses: zwaldowski/semver-release-action@v3
id: semver
with:
bump: prerelease
github_token: ${{ secrets.GITHUB_TOKEN }}
dry_run: true
preid: 'dev'
- name: Update version in package.json
run: npm version ${{ steps.semver.outputs.version_tag }} --no-git-tag-version
- name: Build
run: pnpm build
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
- name: Create changelog
run: |
git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:"* %B" > changelog.txt
echo 'CHANGELOG<<CHANGELOG_END' >> $GITHUB_ENV
cat changelog.txt >> $GITHUB_ENV
echo -e '\nCHANGELOG_END' >> $GITHUB_ENV
# - name: Commit package.json
# uses: stefanzweifel/git-auto-commit-action@v4
# with:
# branch: master
# commit_message: Bump version in package.json to ${{ steps.semver.outputs.version_tag }}
# file_pattern: package.json
# skip_fetch: true
- name: Create build.zip
run: zip -r ../build/Shoko-WebUI-v${{ steps.semver.outputs.version_tag }}.zip ./* -x "**/index*.js.map"
working-directory: ./dist
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: ./build/Shoko-WebUI-v${{ steps.semver.outputs.version_tag }}.zip
tag_name: v${{ steps.semver.outputs.version_tag }}
prerelease: true
fail_on_unmatched_files: true
body_path: ./changelog.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Notify discord
uses: sarisia/actions-status-discord@v1
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
nodetail: true
title: New WebUI Dev Build!
description: |
**Version**: `${{ steps.semver.outputs.version_tag }}`
Update from the WebUI or click [here](https://github.com/${{ github.repository }}/releases/tag/v${{ steps.semver.outputs.version_tag }}) to download!
**Changelog**:
${{ env.CHANGELOG }}