-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Set up release automation & tweak builds
- Loading branch information
1 parent
324054c
commit b5fa14e
Showing
3 changed files
with
118 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Release | ||
|
||
permissions: | ||
contents: write | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
env: | ||
CARGO_INCREMENTAL: 0 | ||
CARGO_NET_GIT_FETCH_WITH_CLI: true | ||
CARGO_NET_RETRY: 10 | ||
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 1 | ||
CARGO_PROFILE_RELEASE_LTO: true | ||
CARGO_PROFILE_RELEASE_OPT_LEVEL: "s" | ||
CARGO_TERM_COLOR: always | ||
RUST_BACKTRACE: 1 | ||
CC: clang | ||
RUSTFLAGS: -D warnings -Clink-arg=-Wl,--compress-debug-sections=zlib | ||
RUSTUP_MAX_RETRIES: 10 | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
upload-assets: | ||
name: ${{ matrix.target }} | ||
if: github.repository_owner == 'VorpalBlade' && startsWith(github.event.release.name, 'paketkoll-v') | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
matrix: | ||
include: | ||
- target: aarch64-unknown-linux-musl | ||
- target: armv7-unknown-linux-musleabihf | ||
- target: i686-unknown-linux-musl | ||
- target: riscv64gc-unknown-linux-gnu | ||
- target: x86_64-unknown-linux-musl | ||
timeout-minutes: 60 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Install Rust toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
- uses: taiki-e/install-action@cross | ||
- uses: taiki-e/upload-rust-binary-action@v1 | ||
with: | ||
bin: paketkoll | ||
target: ${{ matrix.target }} | ||
# Include version number. | ||
archive: $bin-$tag-$target | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# TODO: Add AUR package build and upload (copy chezmoi_modify_manager) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
[workspace] | ||
git_release_enable = false | ||
|
||
[[package]] | ||
name = "paketkoll_core" | ||
publish_no_verify = true | ||
|
||
[[package]] | ||
name = "paketkoll" | ||
# We only want GH releases for the binary | ||
git_release_enable = true | ||
git_release_type = "auto" | ||
|
||
[changelog] | ||
body = """ | ||
{% if version %}\ | ||
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} | ||
{% else %}\ | ||
## [unreleased] | ||
{% endif %}\ | ||
{% for group, commits in commits | group_by(attribute="group") %} | ||
### {{ group | striptags | trim | upper_first }} | ||
{% for commit in commits %} | ||
- {% if commit.scope %}*({{ commit.scope }})* {% endif %}\ | ||
{% if commit.breaking %}[**breaking**] {% endif %}\ | ||
{{ commit.message | upper_first }}\ | ||
{% endfor %} | ||
{% endfor %}\n | ||
""" | ||
header = """ | ||
# Changelog\n | ||
All notable changes to this project will be documented in this file. | ||
Keep in mind that this is only updated when releases are made and the file | ||
is generated automatically from commit messages.\n | ||
For a possibly more edited message (for major changes) please see the github | ||
releases.\n | ||
""" | ||
protect_breaking_commits = true | ||
sort_commits = "newest" | ||
trim = true | ||
|
||
commit_preprocessors = [ | ||
# remove issue numbers from commits | ||
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" }, | ||
] | ||
|
||
commit_parsers = [ | ||
{ message = "^feat", group = "<!-- 0 -->π Shiny new things (features)" }, | ||
{ message = "^fix", group = "<!-- 1 -->π No longer broken (bug fixes)" }, | ||
{ message = "^doc", group = "<!-- 3 -->π Things to read (documentation)" }, | ||
{ message = "^perf", group = "<!-- 4 -->β‘ Go faster! (performance)" }, | ||
{ message = "^refactor", group = "<!-- 2 -->π Now more maintainable (refactor)" }, | ||
{ message = "^style", group = "<!-- 5 -->π¨ Now easier to read (styling)" }, | ||
{ message = "^test", group = "<!-- 6 -->π§ͺ Now we know (testing)" }, | ||
{ message = "^(churn|chore)\\(release\\): prepare for", skip = true }, | ||
{ message = "^(churn|chore)\\(deps.*\\)", skip = true }, | ||
{ message = "^(churn|chore)\\(pr\\)", skip = true }, | ||
{ message = "^(churn|chore)\\(pull\\)", skip = true }, | ||
{ message = "^churn|chore|ci", group = "<!-- 7 -->βοΈ Other stuff" }, | ||
{ body = ".*security", group = "<!-- 8 -->π‘οΈ Security" }, | ||
{ message = "^revert", group = "<!-- 9 -->βοΈ Revert" }, | ||
] |