Skip to content

[FORUMS] Remove features integrated into the base forums (#121) #54

[FORUMS] Remove features integrated into the base forums (#121)

[FORUMS] Remove features integrated into the base forums (#121) #54

Workflow file for this run

name: Release
on:
push:
branches:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-beta'
- '[0-9]+.[0-9]+.[0-9]+-alpha'
- '[0-9]+.[0-9]+.[0-9]+-draft'
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v3
- name: Install Modules
run: npm install
- name: Compile TypeScript
run: npm run build
- name: Move Files
run: |
for file in dist/*.js; do
mv "$file" .
done
- name: Minify JavaScript
run: |
for file in *.js; do
npx uglifyjs "$file" -o "${file%.js}.js" --compress --mangle toplevel --comments "/\s(==\/?UserScript==|@.+$)/"
done
- name: Create Environment Variables (Prerelease)
if: "contains(github.ref_name, 'beta') || contains(github.ref_name, 'alpha')"
run: echo "RELEASE_TYPE= - $(echo ${{ github.ref_name }} | cut -d'-' -f 2 | sed -e 's/\b\(.\)/\u\1/g')" >> $GITHUB_ENV
- name: Create Environment Variables (Release)
if: "!(contains(github.ref_name, 'beta') || contains(github.ref_name, 'alpha'))"
run: echo "RELEASE_TYPE=" >> $GITHUB_ENV
- name: Apply Environment Variables
run: |
for file in *.js; do
sed -i "s/%RELEASE_TYPE%/${{ env.RELEASE_TYPE }}/g" "$file"
done
- name: Rename Files to UserScript
run: |
for file in *.js; do
mv "$file" "${file%.js}.user.js"
done
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: "*.user.js"
name: Batch Release ${{ env.RELEASE_VERSION }}
tag: ${{ env.RELEASE_VERSION }}-release
body: |
This is an automated release of all the scripts in this repository. Each script has its own version number (seen in the Script's `@version` tag in the header), not all of them may have been updated with this batch release (it might only be one or two). The release number shown is this release is just a batch number for the entire repository. It has nothing to do with the individual scripts.
The easiest way to determine if you need to update is to click each of the Assets and see if Tampermonkey prompts you to update. Alternatively, see if you can determine it from the release notes below.
makeLatest: true
allowUpdates: true
generateReleaseNotes: true
removeArtifacts: true
omitBodyDuringUpdate: true
prerelease: ${{ contains(github.ref_name, 'beta') || contains(github.ref_name, 'alpha') }}
draft: ${{ contains(github.ref_name, 'draft') }}
env:
RELEASE_VERSION: ${{ github.ref_name }}