Skip to content

test: update build.properties with docker #15

test: update build.properties with docker

test: update build.properties with docker #15

name: Update Build Versions
on:
pull_request:
paths:
- 'build.properties'
env:
REPO_OWNER: musicEnfanthen
DOCKER_REPO: docker-mei
TEMP_DIR: temp
jobs:
update-build-commandline:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout main repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.head_ref }}
- name: Set up Python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: '3.13'
- name: Upgrade pip
run: |
python -m pip install --upgrade pip
- name: Update build versions in BUILD_COMMANDLINE.md
run: |
python utils/build/update_build_versions.py --markdown
- name: Commit and push changes for BUILD_COMMANDLINE.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add BUILD_COMMANDLINE.md
if ! git diff-index --quiet HEAD; then
git commit -m 'docs: update build versions in BUILD_COMMANDLINE.md'
git push origin HEAD:${{ github.head_ref }}
else
echo "No changes to commit"
fi
update-dockerfile:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout docker-mei repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: ${{ env.REPO_OWNER }}/${{ env.DOCKER_REPO }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout main repository into TEMP_DIR
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.head_ref }}
# relative path under $GITHUB_WORKSPACE to place the repository
path: ${{ env.TEMP_DIR }}
- name: Set up Python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: '3.13'
- name: Upgrade pip
run: |
python -m pip install --upgrade pip
- name: Copy Dockerfile to main repository
run: |
touch {{ env.TEMP_DIR }}/Dockerfile
cp Dockerfile {{ env.TEMP_DIR }}/Dockerfile
- name: Update build versions in Dockerfile
working-directory: ${{ env.TEMP_DIR }}
run: |
python utils/build/update_build_versions.py --docker
- name: Copy Dockerfile back to docker-mei repository
run: |
cp {{ env.TEMP_DIR }}/Dockerfile Dockerfile
- name: Verify changes in Dockerfile
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git status
- name: Create pull request in docker-mei repository
id: cpr
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7.0.6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'build: update build versions in Dockerfile'
branch: feature/update-build-versions
title: 'build: update build versions in Dockerfile'
body: 'This PR updates the build versions in the Dockerfile.'
base: main
- name: Check outputs
if: ${{ steps.cpr.outputs.pull-request-number }}
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"