Check Dev Release #6
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: Check Dev Release | ||
on: | ||
schedule: | ||
- cron: '0 0 * * *' # Runs daily at midnight | ||
workflow_dispatch: # Allows manual triggering | ||
jobs: | ||
check-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Check latest release version from Anaconda | ||
id: check_anaconda | ||
run: | | ||
# Variables | ||
ANACONDA_API_URL="https://api.anaconda.org/package/bsteubing/activity-browser-dev" | ||
LABEL="main" | ||
# Fetch the package information from Anaconda | ||
PACKAGE_INFO=$(curl -s $ANACONDA_API_URL) | ||
# Extract the latest version for the specified label | ||
LATEST_VERSION=$(echo $PACKAGE_INFO | jq -r --arg LABEL "$LABEL" '.files[] | select(.labels[] == $LABEL) | .version' | sort -V | tail -n 1) | ||
echo "LATEST_VERSION=$LATEST_VERSION" >> $GITHUB_ENV | ||
# Read the local version from version.json | ||
LOCAL_VERSION=$(jq -r .dev ab_releases/current.json) | ||
echo "Current version: $LOCAL_VERSION" | ||
echo "LOCAL_VERSION=$LOCAL_VERSION" >> $GITHUB_ENV | ||
build-dev-windows: | ||
runs-on: windows-latest | ||
needs: check-release | ||
if: ${{ env.LOCAL_VERSION != env.LATEST_VERSION }} | ||
Check failure on line 38 in .github/workflows/check_dev_update.yml GitHub Actions / Check Dev ReleaseInvalid workflow file
|
||
steps: | ||
- name: Perform action if new version is found | ||
if: steps.check_anaconda.outputs.new_version == 'true' | ||
run: | | ||
echo "New version found, performing actions..." | ||
# Add your actions here, for example: | ||
# - Send a notification | ||
# - Create an issue | ||
# - Trigger another workflow |