Skip to content

Release

Release #99

Workflow file for this run

name: Release
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
env:
RELEASE_NAME: $(date +'%Y-%m-%d')
PREVIOUS_RELEASE_NAME: $(date -d 'yesterday' +'%Y-%m-%d')
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
id: install-dependencies
run:
|
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run project command
id: run-cmd
run: python -m odg -r -c -s
- name: Release preparations
id: release-prep
run:
|
cd itembuilds
zip -q -r ../itembuilds.zip .
cd ..
echo "RELEASE_NAME=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Generate diff file
id: gen-diff
run:
|
curl -s -L -o "PREVIOUS_RELEASE.zip" https://github.com/Egezenn/OpenDotaGuides/releases/latest/download/itembuilds.zip
unzip -q "PREVIOUS_RELEASE.zip" -d "PREVIOUS_RELEASE"
chmod +x ./odg/scripts/diff.sh
./odg/scripts/diff.sh "itembuilds" "PREVIOUS_RELEASE"
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.RELEASE_NAME }}
body: Daily release
files:
|
itembuilds.zip
comparison.diff
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Cleanup
run:
|
rm -r data itembuilds PREVIOUS_RELEASE
rm odg.log itembuilds.zip PREVIOUS_RELEASE.zip comparison.diff