Skip to content

Minor fixes (#958) #411

Minor fixes (#958)

Minor fixes (#958) #411

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@v4
with:
fetch-depth: 0
- name: Setup Node.js v20
uses: actions/setup-node@v4
with:
node-version: 20
- name: Setup pnpm and install dependencies
uses: pnpm/action-setup@v3
with:
version: 9
run_install: true
- name: Lint
run: pnpm lint --quiet
- name: Determine bump type
uses: zwaldowski/match-label-action@v5
id: bump
with:
allowed: premajor,preminor,prepatch
default_match: prerelease
- name: Get new version
uses: zwaldowski/semver-release-action@v3
id: semver
with:
bump: ${{ steps.bump.outputs.match }}
github_token: ${{ secrets.GITHUB_TOKEN }}
dry_run: true
preid: 'dev'
- name: Update version in package.json
run: pnpm 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: 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@v2
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: Get current datetime
id: date
run: echo "date=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_OUTPUT
- name: Notify discord
uses: tsickert/[email protected]
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK }}
embed-color: 7641851
embed-timestamp: ${{ steps.date.outputs.date }}
embed-author-name: Web UI | New Daily Build
embed-author-icon-url: https://raw.githubusercontent.com/${{ github.repository }}/master/.github/images/webui.png
embed-author-url: https://github.com/${{ github.repository }}
embed-description: |
**Version**: `${{ steps.semver.outputs.version_tag }}`
Update from the Web UI or click [here](https://github.com/${{ github.repository }}/releases/tag/v${{ steps.semver.outputs.version_tag }}) to download!
**Changes since last build**:
${{ env.CHANGELOG }}