-
-
Notifications
You must be signed in to change notification settings - Fork 2
53 lines (53 loc) · 1.77 KB
/
track-upstream.yml
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
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
name: Track upstream activity
jobs:
track-commits:
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
token: ${{ secrets.PUSH_TOKEN }}
- name: Update upstream code
run: |
git -C yosys-src pull --ff-only origin main
git -C SymbiYosys-src pull --ff-only origin main
- name: Push updated code
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Update dependencies.
track-releases:
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
token: ${{ secrets.PUSH_TOKEN }}
- name: Check out new upstream tag
id: checkout-tag
run: |
for tag in $(git -C yosys-src tag -l '0.*' | sort -rV); do
ref=$(git -C yosys-src rev-parse $tag)
branch=develop-${tag}
if ! git rev-parse -q --verify remotes/origin/${branch} >/dev/null; then
echo "New branch ${branch} with yosys-src ${ref}"
git -C yosys-src checkout ${ref}
# 2023-02-06: https://github.com/YosysHQ/sby/issues/229
echo "version=${tag}" >> $GITHUB_OUTPUT
break
fi;
done
- name: Push new branch
uses: stefanzweifel/git-auto-commit-action@v5
if: steps.checkout-tag.outputs.version
with:
commit_message: "[autorelease] Yosys ${{ steps.checkout-tag.outputs.version }}."
branch: develop-${{ steps.checkout-tag.outputs.version }}
create_branch: true