tag #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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 |