this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

build: migrate release flow to release-plz with publish workflow

+205 -105
+41
.config/release-plz.toml
··· 1 + # release-plz configuration 2 + # https://release-plz.dev/docs/config 3 + 4 + [workspace] 5 + # Tags like vX.Y.Z 6 + git_tag_name = "v{{ version }}" 7 + 8 + # Customize the pull request 9 + pr_name = "chore: release v{{ version }}" 10 + pr_body = """ 11 + {% for release in releases -%} 12 + ## Release v{{ release.next_version }} 13 + 14 + This PR prepares the next release. The changelog has been automatically generated from commit messages. 15 + 16 + **Before merging:** 17 + - Review the version bump ({{ release.previous_version }} → {{ release.next_version }}) 18 + - Review semver compatibility: {{ release.semver_check }} 19 + - Edit `CHANGELOG.md` to add any custom commentary, context, or highlights 20 + - Ensure all changes are documented appropriately 21 + 22 + After merging, the package will be automatically published to crates.io and a GitHub release will be created with tag `v{{ release.next_version }}`. 23 + {% endfor -%} 24 + """ 25 + 26 + # Add labels to release PRs for easier filtering 27 + pr_labels = ["release"] 28 + 29 + # Customize GitHub release 30 + git_release_type = "auto" 31 + git_release_body = """ 32 + {{ changelog }} 33 + 34 + --- 35 + **Installation:** 36 + ```bash 37 + cargo install cmprss@{{ version }} 38 + ``` 39 + 40 + **Repository:** https://github.com/arcuru/cmprss 41 + """
+86
.github/workflows/publish.yml
··· 1 + # Publish workflow — builds snap package and publishes to the Snap Store. 2 + # 3 + # Triggers: 4 + # 1. workflow_run: After Nix CI passes on main. Builds the snap to validate 5 + # the packaging pipeline on every push to main. 6 + # 7 + # 2. release (published): After release-plz creates a GitHub release and tag. 8 + # Builds the snap with the release version and publishes to the Snap Store. 9 + # 10 + # 3. workflow_dispatch: Manual retry for a failed release. Accepts a tag name 11 + # input and publishes the snap for that tag. 12 + # 13 + # On release day, both triggers 1 and 2 fire independently — the workflow_run 14 + # from the merge to main, and the release event from release-plz tagging. This 15 + # is intentional: the dev run validates the pipeline, and the release run 16 + # publishes the versioned snap. 17 + 18 + name: Publish 19 + 20 + on: 21 + workflow_run: 22 + workflows: ["Nix"] 23 + types: [completed] 24 + branches: ["main"] 25 + release: 26 + types: [published] 27 + workflow_dispatch: 28 + inputs: 29 + tag_name: 30 + description: "Release tag to retry (e.g. v1.2.3)" 31 + required: true 32 + type: string 33 + 34 + jobs: 35 + snap: 36 + name: Snap 37 + runs-on: ubuntu-latest 38 + if: | 39 + github.repository_owner == 'arcuru' && 40 + (github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success') 41 + environment: ${{ (github.event_name == 'release' || github.event_name == 'workflow_dispatch') && 'publish' || '' }} 42 + steps: 43 + - name: Resolve ref 44 + id: ref 45 + env: 46 + EVENT_NAME: ${{ github.event_name }} 47 + RELEASE_TAG: ${{ github.event.release.tag_name }} 48 + INPUT_TAG: ${{ inputs.tag_name }} 49 + RUN_SHA: ${{ github.event.workflow_run.head_sha || github.sha }} 50 + run: | 51 + if [[ "$EVENT_NAME" == "release" ]]; then 52 + echo "ref=$RELEASE_TAG" >> "$GITHUB_OUTPUT" 53 + elif [[ "$EVENT_NAME" == "workflow_dispatch" ]]; then 54 + echo "ref=$INPUT_TAG" >> "$GITHUB_OUTPUT" 55 + else 56 + echo "ref=$RUN_SHA" >> "$GITHUB_OUTPUT" 57 + fi 58 + 59 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 60 + with: 61 + ref: ${{ steps.ref.outputs.ref }} 62 + 63 + - name: Set snap version from release tag 64 + if: github.event_name == 'release' || github.event_name == 'workflow_dispatch' 65 + env: 66 + TAG: ${{ github.event.release.tag_name || inputs.tag_name }} 67 + run: | 68 + VERSION="${TAG#v}" 69 + sed -i "s/^version: .*/version: \"${VERSION}\"/" snap/snapcraft.yaml 70 + 71 + - uses: snapcore/action-build@d12445ae70c52b1ead8b8a0ac6635f0432af5c80 # v1.3.0 72 + id: build 73 + 74 + - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 75 + with: 76 + name: snap 77 + path: ${{ steps.build.outputs.snap }} 78 + 79 + - name: Publish to Snap Store 80 + if: github.event_name == 'release' || github.event_name == 'workflow_dispatch' 81 + uses: snapcore/action-publish@214b86e5ca036ead1668c79571f947af2ee6e1d3 # v1.2.0 82 + env: 83 + SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} 84 + with: 85 + snap: ${{ steps.build.outputs.snap }} 86 + release: stable
+77
.github/workflows/release-plz.yml
··· 1 + name: Release-plz 2 + 3 + on: 4 + push: 5 + branches: 6 + - main 7 + workflow_dispatch: 8 + 9 + jobs: 10 + release-plz-release: 11 + name: Release-plz release 12 + runs-on: ubuntu-latest 13 + if: github.repository_owner == 'arcuru' && (github.event_name == 'push' || github.ref == 'refs/heads/main') 14 + environment: publish 15 + permissions: 16 + contents: write 17 + id-token: write 18 + steps: 19 + - name: Checkout repository 20 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 21 + - name: Install Rust toolchain 22 + uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # master 23 + with: 24 + toolchain: stable 25 + - name: Rust Cache 26 + uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2 27 + 28 + - name: Authenticate with crates.io 29 + uses: rust-lang/crates-io-auth-action@bbd81622f20ce9e2dd9622e3218b975523e45bbe # v1.0.4 30 + id: cratesio-auth 31 + 32 + - name: Run release-plz 33 + uses: release-plz/action@f708778669256143d984cce4b23592637532e040 # v0.5.127 34 + with: 35 + command: release 36 + config: .config/release-plz.toml 37 + env: 38 + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 39 + CARGO_REGISTRY_TOKEN: ${{ steps.cratesio-auth.outputs.token }} 40 + 41 + release-plz-pr: 42 + name: Release-plz PR 43 + runs-on: ubuntu-latest 44 + if: ${{ github.repository_owner == 'arcuru' }} 45 + permissions: 46 + contents: write 47 + pull-requests: write 48 + concurrency: 49 + group: release-plz-${{ github.ref }} 50 + cancel-in-progress: false 51 + steps: 52 + - name: Checkout repository 53 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 54 + - name: Install Rust toolchain 55 + uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # master 56 + with: 57 + toolchain: stable 58 + - name: Rust Cache 59 + uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2 60 + 61 + - name: Check if release PR exists 62 + id: check-pr 63 + if: github.event_name == 'push' 64 + run: | 65 + PR_EXISTS=$(gh pr list --repo "$GITHUB_REPOSITORY" --head release-plz --state open --json number --jq 'length') 66 + echo "exists=$PR_EXISTS" >> "$GITHUB_OUTPUT" 67 + env: 68 + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 69 + 70 + - name: Run release-plz 71 + if: github.event_name == 'workflow_dispatch' || steps.check-pr.outputs.exists != '0' 72 + uses: release-plz/action@f708778669256143d984cce4b23592637532e040 # v0.5.127 73 + with: 74 + command: release-pr 75 + config: .config/release-plz.toml 76 + env: 77 + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-21
.github/workflows/release-publish.yml
··· 1 - name: Snap 2 - 3 - on: 4 - push: 5 - branches: ["main"] 6 - pull_request: 7 - branches: ["main"] 8 - 9 - jobs: 10 - snap: 11 - runs-on: ubuntu-latest 12 - steps: 13 - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 14 - 15 - - uses: snapcore/action-build@d12445ae70c52b1ead8b8a0ac6635f0432af5c80 # v1.3.0 16 - id: build 17 - 18 - - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 19 - with: 20 - name: snap 21 - path: ${{ steps.build.outputs.snap }}
-83
cliff.toml
··· 1 - # git-cliff ~ default configuration file 2 - # https://git-cliff.org/docs/configuration 3 - # 4 - # Lines starting with "#" are comments. 5 - # Configuration options are organized into tables and keys. 6 - # See documentation for more information on available options. 7 - 8 - [changelog] 9 - # changelog header 10 - header = """ 11 - # Changelog\n 12 - All notable changes to this project will be documented in this file.\n 13 - """ 14 - # template for the changelog body 15 - # https://keats.github.io/tera/docs/#introduction 16 - body = """ 17 - {% if version %}\ 18 - ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} 19 - {% else %}\ 20 - ## [unreleased] 21 - {% endif %}\ 22 - {% for group, commits in commits | group_by(attribute="group") %} 23 - ### {{ group | upper_first }} 24 - {% for commit in commits %} 25 - - {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}\ 26 - {% endfor %} 27 - {% endfor %}\n 28 - """ 29 - # remove the leading and trailing whitespace from the template 30 - trim = true 31 - # changelog footer 32 - footer = """ 33 - <!-- generated by git-cliff --> 34 - """ 35 - # postprocessors 36 - postprocessors = [ 37 - # { pattern = '<REPO>', replace = "https://github.com/orhun/git-cliff" }, # replace repository URL 38 - ] 39 - [git] 40 - # parse the commits based on https://www.conventionalcommits.org 41 - conventional_commits = true 42 - # filter out the commits that are not conventional 43 - filter_unconventional = true 44 - # process each line of a commit as an individual commit 45 - split_commits = false 46 - # regex for preprocessing the commit messages 47 - commit_preprocessors = [ 48 - # { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))"}, # replace issue numbers 49 - ] 50 - # regex for parsing and grouping commits 51 - commit_parsers = [ 52 - { message = "^feat", group = "Features" }, 53 - { message = "^fix", group = "Bug Fixes" }, 54 - { message = "^doc", group = "Documentation" }, 55 - { message = "^perf", group = "Performance" }, 56 - { message = "^refactor", group = "Refactor" }, 57 - { message = "^style", group = "Styling" }, 58 - { message = "^test", group = "Testing" }, 59 - { message = "^chore\\(release\\): prepare for", skip = true }, 60 - { message = "^chore\\(deps\\)", skip = true }, 61 - { message = "^chore\\(pr\\)", skip = true }, 62 - { message = "^chore\\(pull\\)", skip = true }, 63 - { message = "^chore|ci", group = "Miscellaneous Tasks" }, 64 - { body = ".*security", group = "Security" }, 65 - { message = "^revert", group = "Revert" }, 66 - ] 67 - # protect breaking changes from being skipped due to matching a skipping commit_parser 68 - protect_breaking_commits = false 69 - # filter out the commits that are not matched by commit parsers 70 - filter_commits = false 71 - # regex for matching git tags 72 - tag_pattern = "v[0-9].*" 73 - 74 - # regex for skipping tags 75 - skip_tags = "v0.1.0-beta.1" 76 - # regex for ignoring tags 77 - ignore_tags = "" 78 - # sort the tags topologically 79 - topo_order = false 80 - # sort the commits inside sections by oldest/newest order 81 - sort_commits = "oldest" 82 - # limit the number of commits included in the changelog. 83 - # limit_commits = 42
+1 -1
snap/snapcraft.yaml
··· 1 1 name: cmprss 2 - version: "0.2.0" 2 + version: git 3 3 summary: A compression multi-tool for the command line 4 4 description: | 5 5 Replace tar with something you can remember.