forked from micro-manager/pycro-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (50 loc) · 2.05 KB
/
Java_dependency_update.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
56
57
# When NDTiff, AcqEngJ, or NDViewer update, a automatic push
# to the dependency-update branch of pycro-manager will be generated
# that updates the version in their POM.xml files
# This script should then:
# 1) Update the minor or patch version of PMJava accordingly
# 2) Open a pull request from the dependency branch to the main branch to
# trigger automatic build of pycro-manager Java
name: Pycro-ManagerJava update
on:
push:
branches:
- dependency-update
paths:
- 'java/pom.xml'
jobs:
update-pycromanger-java:
runs-on: ubuntu-latest
steps:
- name: Checkout Pycro-Manager dependencies branch
uses: actions/checkout@v3
with:
path: ''
repository: micro-manager/pycro-manager
ref: dependencies
fetch-depth: 0 # check out all branches so main can be merged
token: ${{ secrets.GITHUB_TOKEN }}
ref: dependency-update
- name: update-version
run: |
# fast forward to get code updates on main branch
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "PycroManager-Bot"
git config pull.rebase false
git merge origin/main -m "dependency update merge"
pip install semantic_version
python build_automation/update_PycroManagerJava.py
- name: commit
run: |
git commit -am "update PycromanagerJava version"
- name: push
run: |
git pull # Get changes in case of simultaneous calls to script
git push https://henrypinkard:${{ secrets.GITHUB_TOKEN }}@github.com/micro-manager/pycro-manager.git
- name: create pull request
continue-on-error: true
run: |
gh pr create -H dependency-update -B main --title 'Java dependency auto-update' --body 'Created by Github action (https://github.com/micro-manager/pycro-manager/blob/dependency-update/.github/workflows/Java_dependency_update.yml)'
gh pr merge --auto --merge
env:
GITHUB_TOKEN: ${{ secrets.PYCRO_TOKEN }}