-
Notifications
You must be signed in to change notification settings - Fork 2.1k
55 lines (48 loc) · 1.77 KB
/
release-please-cargo-lock.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
54
55
on:
push:
branches:
- release-please--branches--main--components--core
name: release-please-update-cargo-lock
jobs:
update_cargo_lock:
# TODO: After migraton switch to CI
runs-on: [matterlabs-default-infra-runners]
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
with:
submodules: "recursive"
persist-credentials: false
- name: Check last commit
id: condition
run: |
COMMIT=$(git log -1 --pretty=%B)
if [[ "$COMMIT" == "Update Cargo.lock" ]]; then
echo "Cargo.lock is already updated"
echo "::set-output name=skip_steps::true"
else
echo "Cargo.lock should be updated"
echo "::set-output name=skip_steps::false"
fi
- name: Setup environment
if: steps.condition.outputs.skip_steps != 'true'
run: |
echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV
echo $(pwd)/bin >> $GITHUB_PATH
echo IN_DOCKER=1 >> .env
- name: Start services
if: steps.condition.outputs.skip_steps != 'true'
run: docker compose up -d zk
- name: Cargo check
if: steps.condition.outputs.skip_steps != 'true'
run: ci_run cargo check
- name: Push changes
if: steps.condition.outputs.skip_steps != 'true'
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "zksync-era-bot"
git remote set-url origin 'https://${{ secrets.RELEASE_TOKEN }}@github.com/matter-labs/zksync-era.git'
git add ./Cargo.lock
git commit -m "Update Cargo.lock"
git push