Add friend match and misc fixes #26
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Compile userscript | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Build | |
run: python script/build.py | |
- name: Get previous commit hash | |
run: echo "PREVIOUS_COMMIT_HASH=$(git rev-parse HEAD^)" >> $GITHUB_ENV | |
- name: Set env | |
run: | | |
VERSION=$(cat templates/version) | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
LATEST_RELEASE_VERSION=$(git show $PREVIOUS_COMMIT_HASH:templates/version) | |
if [ -z "$LATEST_RELEASE_VERSION" ]; then | |
LATEST_RELEASE_VERSION="0.0" | |
fi | |
echo "LATEST_RELEASE_VERSION=$LATEST_RELEASE_VERSION" >> $GITHUB_ENV | |
if awk "BEGIN {exit !($VERSION > $LATEST_RELEASE_VERSION)}"; then | |
echo "SHOULD_RELEASE=true" >> $GITHUB_ENV | |
fi | |
echo "VERSION=$VERSION" | |
echo "LATEST_RELEASE_VERSION=$LATEST_RELEASE_VERSION" | |
- name: Release | |
if: ${{ env.SHOULD_RELEASE == 'true' }} | |
uses: softprops/action-gh-release@v2 | |
with: | |
draft: true | |
files: ASF-STM.user.js | |
name: ASF-STM V${{ env.VERSION }} |