-
Notifications
You must be signed in to change notification settings - Fork 475
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move workflow back to dfhack so it can call other workflows
- Loading branch information
Showing
1 changed file
with
64 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Watch DF Steam Releases | ||
|
||
on: | ||
schedule: | ||
- cron: '8/10 * * * *' | ||
|
||
jobs: | ||
check-steam: | ||
name: Check DF ${{ matrix.df_steam_branch }} branch | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- dfhack_ref: adv-beta | ||
structures_ref: adv-beta | ||
version: 51.01-beta | ||
df_steam_branch: beta | ||
steam_branch: adventure-beta | ||
steps: | ||
- name: Setup steamcmd | ||
id: steamcmd | ||
uses: CyberAndrii/setup-steamcmd@v1 | ||
- name: Get current time | ||
shell: bash | ||
run: echo TIMESTAMP_SECONDS="$(date +'%s')" >> $GITHUB_ENV | ||
- name: Fetch state | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: state | ||
key: watchstate-${{ matrix.version }}-${{ env.TIMESTAMP_SECONDS }} | ||
restore-keys: watchstate-${{ matrix.version }} | ||
- name: Detect changes on branch | ||
shell: bash | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
STEAM_USERNAME: ${{ secrets.STEAM_USERNAME }} | ||
STEAM_CONFIG_VDF: ${{ secrets.STEAM_CONFIG_VDF }} | ||
run: | | ||
mkdir -p $HOME/Steam/config | ||
echo "$STEAM_CONFIG_VDF" | base64 -d >$HOME/Steam/config/config.vdf | ||
timestamp=$(${{ steps.steamcmd.outputs.executable }} \ | ||
+@ShutdownOnFailedCommand 1 \ | ||
+login $STEAM_USERNAME \ | ||
+app_info_request 975370 \ | ||
+app_info_print 975370 \ | ||
+quit | awk '/^{/,0' | awk '/^\t\t"branches"/,0' | awk '/^\t\t\t"beta"/,0' | fgrep timeupdated | head -n1 | cut -d'"' -f4) | ||
echo "timestamp: $timestamp" | ||
mkdir -p state | ||
touch state/timestamp | ||
last_timestamp=$(cat state/timestamp) | ||
echo "last_timestamp: $last_timestamp" | ||
if [ "$timestamp" != "$last_timestamp" ]; then | ||
echo "launching generate-symbols" | ||
echo "$timestamp" >state/timestamp | ||
gh workflow run generate-symbols.yml -R DFHack/dfhack -r ${{ matrix.dfhack_ref }} -f structures_ref=${{ matrix.structures_ref }} -f version=${{ matrix.version }} -f platform=all -f channel=steam -f df_steam_branch=${{ matrix.df_steam_branch }} -f steam_branch=${{ matrix.steam_branch }} | ||
echo TIMESTAMP_UPDATED=1 >> $GITHUB_ENV | ||
fi | ||
- name: Save state | ||
uses: actions/cache/save@v4 | ||
if: env.TIMESTAMP_UPDATED | ||
with: | ||
path: state | ||
key: watchstate-${{ matrix.version }}-${{ env.TIMESTAMP_SECONDS }} |