Files
pezkuwi-sdk/.github/workflows/release-clobber-stable.yml
T
pezkuwichain 830dcc9bba Development (#172)
* docs: Add CLAUDE_RULES.md with strict rebrand protection rules

- Define immutable rebrand rules that cannot be violated
- Prohibit reverting rebrand for cargo check convenience
- Establish checkpoint and audit trail requirements
- Document correct error handling approach

* refactor: Complete kurdistan-sdk to pezkuwi-sdk rebrand

- Update README.md with pezkuwi-sdk branding
- Replace all kurdistan-sdk URL references with pezkuwi-sdk
- Replace kurdistan-tech with pezkuwichain in workflows
- Update email domains from @kurdistan-tech.io to @pezkuwichain.io
- Rename tool references: kurdistan-tech-publish → pezkuwi-publish
- Update runner names: kurdistan-tech-* → pezkuwichain-*
- Update analytics/forum/matrix domains to pezkuwichain.io
- Keep 'Kurdistan Tech Institute' as organization name
- Keep tech@kurdistan.gov as official government contact
2025-12-19 23:30:43 +03:00

71 lines
2.3 KiB
YAML

name: Clobber Stable
# This action implements the
# [Clobbering](https://github.com/pezkuwichain/pezkuwi-sdk/blob/master/docs/RELEASE.md#clobbering)
# process from the release process. It pushes a new commit to the `stable` branch with all the
# current content of the `audited` tag. It does not use a merge commit, but rather 'clobbers' the
# branch with a single commit that contains all the changes. It has a naming scheme of `Clobber with
# audited ($COMMIT)`.
# Currently, the script is only triggered manually, but can be easily changed to a schedule.
on:
workflow_dispatch:
permissions:
contents: write
jobs:
clobber-stable:
runs-on: ubuntu-latest
timeout-minutes: 5
env:
STABLE: stable
UNSTABLE: master
AUDITED: audited
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4.1.7
- name: Prechecks
run: |
# Properly fetch
git fetch --prune --unshallow origin tag $AUDITED
git fetch origin $STABLE
# Sanity checks
git checkout -q tags/$AUDITED || (echo "Could not find the '$AUDITED' tag." && exit 1)
COMMIT=$(git rev-parse tags/$AUDITED)
#$(git branch --contains $COMMIT | grep -q $UNSTABLE) || (echo "The '$AUDITED' tag is not on the '$UNSTABLE' branch." && exit 1)
git config --global user.email "admin@pezkuwichain.io"
git config --global user.name "Kurdistan-Tech Release Team"
- name: Prepare commit
run: |
git checkout --quiet origin/$STABLE
# Delete all tracked files in the working directory
git ls-files -z | xargs -0 rm -f
# Find and delete any empty directories
find . -type d -empty -delete
git add . 1>/dev/null 2>/dev/null
git commit -qm "Delete all files"
# Grab the files from the commit
git checkout --quiet tags/$AUDITED -- .
# Stage, commit, and push the working directory which now matches 'audited' 1:1
git status
COMMIT=$(git rev-parse --short=10 tags/$AUDITED)
git add . 1>/dev/null 2>/dev/null
git commit --allow-empty --amend -qm "Clobber with $AUDITED ($COMMIT)"
- name: Push stable branch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git log -3
git push --verbose origin HEAD:$STABLE