-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (79 loc) · 2.82 KB
/
Copy pathversion-bumps.yml
File metadata and controls
93 lines (79 loc) · 2.82 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: version-bumps
on:
workflow_dispatch:
inputs:
meshix_cli_version:
description: Optional Meshix CLI release tag to pin for this run (for example v0.0.2)
required: false
schedule:
- cron: '23 6 * * *'
permissions:
contents: write
pull-requests: write
jobs:
update:
runs-on: ubuntu-latest
container:
image: archlinux:base-devel
env:
GH_TOKEN: ${{ github.token }}
SHPIT_GH_TOKEN: ${{ secrets.SHPIT_GH_TOKEN }}
MESHIX_CLI_VERSION: ${{ github.event.inputs.meshix_cli_version || '' }}
UPDATE_BRANCH: automation/version-bumps
steps:
- name: Install updater dependencies
run: pacman -Syu --noconfirm git github-cli jq unzip
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Mark workspace as safe
run: git config --global --add safe.directory "${GITHUB_WORKSPACE}"
- name: Configure git identity
run: |
git config user.name "shpit-bot"
git config user.email "opensource@shpit.dev"
- name: Update packages
run: ./scripts/update-packages.sh auto
- name: Detect changes
id: detect
run: |
if git diff --quiet; then
echo 'changed=false' >> "${GITHUB_OUTPUT}"
else
echo 'changed=true' >> "${GITHUB_OUTPUT}"
fi
- name: Commit and push branch
if: ${{ steps.detect.outputs.changed == 'true' }}
run: |
git checkout -B "${UPDATE_BRANCH}"
git add README.md docs scripts .github/workflows meshix-cli-bin tabex-bin osyrra-bin
git commit -m "chore(pkgbuilds): bump package versions"
git push --force --set-upstream origin "${UPDATE_BRANCH}"
- name: Open or update pull request
if: ${{ steps.detect.outputs.changed == 'true' }}
run: |
#!/usr/bin/env bash
set -euo pipefail
pr_number="$(gh pr list \
--head "${UPDATE_BRANCH}" \
--base main \
--json number \
--jq '.[0].number // empty')"
title="chore(pkgbuilds): bump package versions"
body_file="$(mktemp)"
cat <<'EOF' > "${body_file}"
## Summary
- update SHPIT package definitions to the latest discovered upstream versions
- refresh checksums and `.SRCINFO`
- keep the public repo metadata aligned with the package automation flow
EOF
if [[ -n "${pr_number}" ]]; then
gh pr edit "${pr_number}" --title "${title}" --body-file "${body_file}"
else
gh pr create \
--base main \
--head "${UPDATE_BRANCH}" \
--title "${title}" \
--body-file "${body_file}"
fi