-
Notifications
You must be signed in to change notification settings - Fork 29
44 lines (42 loc) · 1.68 KB
/
bump.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
---
name: bump
on: [repository_dispatch]
jobs:
bump:
if: github.event_name == 'repository_dispatch' && github.event.action == 'tag'
runs-on: ubuntu-22.04
env:
DISPLAY: ':10'
steps:
- name: Information
run: |
echo "Version update for ${{ github.event.client_payload.package_name }} -> ${{ github.event.client_payload.package_version }} requested"
- uses: actions/checkout@v4
with:
token: ${{ secrets.TOOL_REPO_ACCESS_TOKEN }}
fetch-depth: 0
- name: Install and run xvfb
run: sudo apt-get update && sudo apt-get install -y xvfb && Xvfb $DISPLAY &
- uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
- name: Tag and push
shell: bash
run: |
git config user.name github-actions
git config user.email [email protected]
TAG_EXISTS=$(git tag -l "${{ github.event.client_payload.package_version }}")
if [ ! "$TAG_EXISTS" ]; then
git am -3 < .github/workflows/0001-Disable-compile-tests-until-GradleRIO-released-.patch
sed -i 's/wpilibRelease = \".*/wpilibRelease = \"${{ github.event.client_payload.package_version }}\";/' src/main/java/robotbuilder/exporters/GenericExporter.java
./gradlew build test -x htmlSanityCheck
git commit -a -m "Bump export version to ${{ github.event.client_payload.package_version }}"
git push origin
fi
git tag -f ${{ github.event.client_payload.package_version }}
git push -f origin ${{ github.event.client_payload.package_version }}
if [ ! "$TAG_EXISTS" ]; then
git revert HEAD~1
git push origin
fi