generated from devcontainers/feature-starter
-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (64 loc) · 2.21 KB
/
schedule.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: "Daily Update and Release"
on:
schedule:
- cron: '0 0 * * *' # Run daily at midnight UTC
workflow_dispatch: # Allow manual triggering
jobs:
update-and-test:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- uses: actions/setup-python@v5
with:
python-version: '3.9'
# keep consistency with local devcontainer settings
- name: Install dependencies for just tasks
env:
PIPX_BIN_DIR: /usr/local/py-utils/bin
PIPX_HOME: /usr/local/py-utils
run: |
sudo mkdir -p $PIPX_BIN_DIR $PIPX_HOME
sudo chown $USER:$USER $PIPX_BIN_DIR $PIPX_HOME
echo $PIPX_BIN_DIR >> $GITHUB_PATH
bash .devcontainer/install-deps.sh
shell: bash
- name: Update lsp-bridge.nix and run tests
id: update_and_test
run: |
if ! just test invalidate_hash; then
echo "First test run failed, retrying..."
if just test; then
echo "Second test run succeeded"
echo "test_passed=true" >> $GITHUB_OUTPUT
# update the version for release tag
just update_version
just generate
else
echo "Second test after re-generation run failed"
exit 1
fi
fi
- name: Commit and push changes if any
if: steps.update_and_test.outputs.test_passed == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name 'GitHub Actions Bot'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add _generator/ src/ test/
if git diff --staged --quiet; then
echo "No changes to commit"
else
git commit -m "Update lsp-bridge to latest version"
git push
fi
- name: Trigger release workflow
if: steps.update_and_test.outputs.test_passed == 'true'
uses: peter-evans/repository-dispatch@v3
with:
event-type: trigger-release