Skip to content

update

update #48

Workflow file for this run

name: update
on:
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
if: github.repository_owner == 'thin-edge'
env:
PR_BRANCH: updater-${{github.ref_name}}
steps:
- uses: actions/checkout@v4
# Only install tooling if not running on a self-hosted runner as the tools are already pre-installed
- uses: taiki-e/install-action@just
if: ${{ !startsWith(runner.name, 'tedge') }}
- uses: actions/setup-python@v5
if: ${{ !startsWith(runner.name, 'tedge') }}
with:
python-version: '3.11'
- run: pip3 install kas
if: ${{ !startsWith(runner.name, 'tedge') }}
- name: Update lock files
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: just update-all-locks
working-directory: kas
- name: Check thin-edge.io version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./scripts/admin.sh update_version
- name: Create PR on new version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -x
git add -A . ||:
if git diff --quiet && git diff --cached --quiet; then
echo "No changes detected"
exit 0
fi
echo "Changes detected. Raising PR"
git status
git config --global user.email "[email protected]"
git config --global user.name "Versioneer"
git checkout -b "$PR_BRANCH"
git commit -am "Update ${{github.ref_name}} branch"
git push --set-upstream origin "$PR_BRANCH"
gh repo set-default ${{github.repository}}
gh pr create --base "${{github.ref_name}}" --title "Update version" --body "Update version" --label ci