name: Changie Release
on:
push:
branches: [main]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Generate app token
id: app-token
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf with:
app-id: ${{ secrets.RELEASE_APP_ID }}
private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd with:
token: ${{ steps.app-token.outputs.token }}
- uses: tylerbutler/actions/changie-release@a2b6f63843eb7510dbcba273bd6638615f668777 id: release
with:
token: ${{ steps.app-token.outputs.token }}
version-files: 'Cargo.toml:version'
- uses: tylerbutler/actions/setup-rust@2189c2e4cd75378b6db8b68ba451bf74d0975c4a if: steps.release.outputs.skipped != 'true'
with:
tools: "just,cargo-bloat"
- name: Update Cargo.lock
if: steps.release.outputs.skipped != 'true'
env:
PR_BRANCH: ${{ steps.release.outputs.pr-branch }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git checkout "$PR_BRANCH"
cargo generate-lockfile
git add Cargo.lock
if ! git diff --cached --quiet; then
git commit -m "chore: update Cargo.lock"
git push origin "$PR_BRANCH"
fi
- name: Record binary sizes
if: steps.release.outputs.skipped != 'true'
env:
PR_BRANCH: ${{ steps.release.outputs.pr-branch }}
run: |
just record-size
just bloat
git add metrics/
if ! git diff --cached --quiet; then
git commit -m "chore: record binary sizes and bloat"
git push origin "$PR_BRANCH"
fi
- name: Summary
if: steps.release.outputs.skipped != 'true'
env:
VERSION: ${{ steps.release.outputs.version }}
PR_URL: ${{ steps.release.outputs.pr-url }}
PR_OP: ${{ steps.release.outputs.pr-operation }}
run: |
echo "### Release PR Created" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "- **Version:** $VERSION" >> "$GITHUB_STEP_SUMMARY"
echo "- **PR:** $PR_URL" >> "$GITHUB_STEP_SUMMARY"
echo "- **Operation:** $PR_OP" >> "$GITHUB_STEP_SUMMARY"
- name: Skipped
if: steps.release.outputs.skipped == 'true'
run: |
echo "### Release Skipped" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "No unreleased change fragments found." >> "$GITHUB_STEP_SUMMARY"