-
Notifications
You must be signed in to change notification settings - Fork 17
55 lines (50 loc) · 1.53 KB
/
autobless.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
name: autobless
on:
schedule:
- cron: '44 4 * * *' # At 4:44 UTC every day.
defaults:
run:
shell: bash
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest]
java-version: ['21']
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: ${{ matrix.java-version }}
- name: Build
run: cargo build --verbose
- name: Test crates, JNI 1.8
run: cargo test --all-targets --verbose --features jni_1_8
- name: Test crates, JNI 1.6
run: cargo test --all-targets --verbose --features jni_1_6
- name: setup bot git name and email
run: |
git config --global user.name 'The Duchess Cronjob Bot'
git config --global user.email '[email protected]'
- name: Push changes to a branch
run: |
BRANCH="bless-$(date -u +%Y-%m-%d)"
git switch -c $BRANCH
git push -u origin $BRANCH
- name: Create Pull Request
run: |
BRANCH="bless-$(date -u +%Y-%m-%d)"
MAIN_SHA=$(git rev-parse main)
BRANCH_SHA=$(git rev-parse $BRANCH)
# Check if the commit hashes are different
if [ "$MAIN_SHA" != "$BRANCH_SHA" ]; then
gh pr create -B main --title 'Automatic bless' --body ''
else
echo "No changes between main and $BRANCH, skipping pull request creation."
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DUCHESS_BLESS: 1