Workflow for building release files #13
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 | |
push: | |
branches: | |
- main | |
jobs: | |
check-release: | |
runs-on: ubuntu-latest | |
outputs: | |
current: steps.check_anaconda.outputs.current | |
latest: steps.check_anaconda.outputs.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 | |
echo "::set-output name=latest::$LATEST_VERSION" | |
# Read the local version from version.json | |
CURRENT_VERSION=$(jq -r .dev ab_releases/current.json) | |
echo "Current version: $CURRENT_VERSION" | |
echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV | |
echo "::set-output name=current::$CURRENT_VERSION" | |
build-dev-windows: | |
runs-on: windows-latest | |
needs: check-release | |
if: ${{ needs.check-release.outputs.current != needs.check-release.outputs.latest }} | |
steps: | |
- uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: ab_releases/dev/windows/win-environment-${{env.CURRENT_VERSION}}.txt | |
create-args: --name environment |