Skip to content

Sync repo templates ⚙ #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/ISSUE_TEMPLATE/release-checklist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
# Template generated by https://github.com/coreos/repo-templates; do not edit downstream
---

# Release process

This project uses [cargo-release][cargo-release] in order to prepare new releases, tag and sign the relevant git commit, and publish the resulting artifacts to [crates.io][crates-io].
The release process follows the usual PR-and-review flow, allowing an external reviewer to have a final check before publishing.

## Requirements

This guide requires:

* A web browser (and network connectivity)
* `git`
* [GPG setup][GPG setup] and personal key for signing
* `cargo` (suggested: latest stable toolchain from [rustup][rustup])
* `cargo-release` (suggested: `cargo install -f cargo-release`)
* Write access to this GitHub project
* A verified account on crates.io
* Membership in the [Fedora CoreOS Crates Owners group](https://github.com/orgs/coreos/teams/fedora-coreos-crates-owners/members), which will give you upload access to crates.io

## Release checklist

These steps show how to release version `x.y.z` on the `origin` remote (this can be checked via `git remote -av`).
Push access to the upstream repository is required in order to publish the new tag and the PR branch.

:warning:: if `origin` is not the name of the locally configured remote that points to the upstream git repository (i.e. `[email protected]:coreos/stream-metadata-rust.git`), be sure to assign the correct remote name to the `UPSTREAM_REMOTE` variable.

- prepare environment:
- [ ] `RELEASE_VER=x.y.z`
- [ ] `UPSTREAM_REMOTE=origin`
- [ ] `git checkout -b pre-release-${RELEASE_VER}`

- write release notes:
- [ ] write release notes in `docs/release-notes.md`
- [ ] `git add docs/release-notes.md && git commit -m "docs/release-notes: update for release ${RELEASE_VER}"`

- land the changes:
- [ ] PR the changes, get them reviewed, approved and merged
- [ ] if doing a branched release, also include a PR to merge the `docs/release-notes.md` changes into main

- make sure the project is clean:
- [ ] Make sure `cargo-release` is up to date: `cargo install cargo-release`
- [ ] `git checkout main && git pull ${UPSTREAM_REMOTE} main`
- [ ] `cargo test --all-features`
- [ ] `cargo clean`
- [ ] `git clean -fd`

- create release commit on a dedicated branch and tag it (the commit and tag will be signed with the GPG signing key you configured):
- [ ] `git checkout -b release-${RELEASE_VER}`
- [ ] `cargo release --execute ${RELEASE_VER}` (and confirm the version when prompted)

- open and merge a PR for this release:
- [ ] `git push ${UPSTREAM_REMOTE} release-${RELEASE_VER}`
- [ ] open a web browser and create a PR for the branch above
- [ ] make sure the resulting PR contains exactly one commit
- [ ] get the PR reviewed, approved and merged

- publish the artifacts (tag and crate):
- [ ] `git checkout v${RELEASE_VER}`
- [ ] verify that `grep "^version = \"${RELEASE_VER}\"$" Cargo.toml` produces output
- [ ] `git push ${UPSTREAM_REMOTE} v${RELEASE_VER}`
- [ ] `cargo publish`

- publish this release on GitHub:
- [ ] find the new tag in the [GitHub tag list](https://github.com/coreos/stream-metadata-rust/tags), click the triple dots menu, and create a release for it
- [ ] copy in the changelog from the release notes doc
- [ ] publish release

- clean up the local environment (optional, but recommended):
- [ ] `cargo clean`
- [ ] `git checkout main`
- [ ] `git pull ${UPSTREAM_REMOTE} main`
- [ ] `git push ${UPSTREAM_REMOTE} :pre-release-${RELEASE_VER} :release-${RELEASE_VER}`
- [ ] `git branch -d pre-release-${RELEASE_VER} release-${RELEASE_VER}`

[cargo-release]: https://github.com/sunng87/cargo-release
[rustup]: https://rustup.rs/
[crates-io]: https://crates.io/
[GPG setup]: https://docs.github.com/en/github/authenticating-to-github/managing-commit-signature-verification
18 changes: 11 additions & 7 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Maintained in https://github.com/coreos/repo-templates
# Do not edit downstream.

version: 2
updates:
- package-ecosystem: cargo
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 10
labels:
- dependency
- package-ecosystem: cargo
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 10
labels:
- dependency
- skip-notes
27 changes: 27 additions & 0 deletions .github/workflows/require-release-note.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Maintained in https://github.com/coreos/repo-templates
# Do not edit downstream.

name: Release notes

on:
pull_request:
branches: [main]
types: [opened, synchronize, reopened, labeled, unlabeled]

permissions:
contents: read

concurrency:
group: release-note-${{ github.ref }}
cancel-in-progress: true

jobs:
require-notes:
name: Require release note
runs-on: ubuntu-latest
steps:
- name: Require release-notes.md update
uses: coreos/actions-lib/require-file-change@main
with:
path: docs/release-notes.md
override-label: skip-notes
86 changes: 55 additions & 31 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,90 +1,114 @@
---
name: Rust
# Maintained in https://github.com/coreos/repo-templates
# Do not edit downstream.

name: Rust
on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

# don't waste job slots on superseded code
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always
# Pinned toolchain for linting
ACTIONS_LINTS_TOOLCHAIN: 1.69.0
ACTIONS_LINTS_TOOLCHAIN: 1.70.0

jobs:
tests-stable:
name: "Tests, stable toolchain"
name: Tests, stable toolchain
runs-on: ubuntu-latest
steps:
- name: Checkout repository
- name: Check out repository
uses: actions/checkout@v3
- name: Install toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
- name: Cache build artifacts
uses: Swatinem/rust-cache@v2
- name: cargo build
run: cargo build
run: cargo build --all-targets
- name: cargo test
run: cargo test
tests-msrv:
name: "Tests, minimum supported toolchain"
run: cargo test --all-targets
tests-release-stable:
name: Tests (release), stable toolchain
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Install toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
- name: Cache build artifacts
uses: Swatinem/rust-cache@v2
- name: cargo build (release)
run: cargo build --all-targets --release
- name: cargo test (release)
run: cargo test --all-targets --release
tests-release-msrv:
name: Tests (release), minimum supported toolchain
runs-on: ubuntu-latest
steps:
- name: Checkout repository
- name: Check out repository
uses: actions/checkout@v3
- name: Detect crate MSRV
shell: bash
run: |
msrv=$(cargo metadata --format-version 1 --no-deps | \
jq -r '.packages | .[].rust_version')
jq -r '.packages[0].rust_version')
echo "Crate MSRV: $msrv"
echo "MSRV=$msrv" >> $GITHUB_ENV
- name: Install toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ env.MSRV }}
- name: cargo build
run: cargo build
- name: cargo test
run: cargo test
lints:
name: "Lints, pinned toolchain"
- name: Cache build artifacts
uses: Swatinem/rust-cache@v2
- name: cargo build (release)
run: cargo build --all-targets --release
- name: cargo test (release)
run: cargo test --all-targets --release
linting:
name: Lints, pinned toolchain
runs-on: ubuntu-latest
steps:
- name: Checkout repository
- name: Check out repository
uses: actions/checkout@v3
- name: Install toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ env['ACTIONS_LINTS_TOOLCHAIN'] }}
toolchain: ${{ env.ACTIONS_LINTS_TOOLCHAIN }}
components: rustfmt, clippy
- name: Cache build artifacts
uses: Swatinem/rust-cache@v2
- name: cargo fmt (check)
run: cargo fmt -- --check -l
- name: cargo clippy (warnings)
run: cargo clippy -- -D warnings
- name: cargo build
run: cargo build
run: cargo clippy --all-targets -- -D warnings
tests-other-channels:
name: "Tests, unstable toolchain"
name: Tests, unstable toolchain
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
channel:
- beta
- nightly
channel: [beta, nightly]
steps:
- name: Checkout repository
- name: Check out repository
uses: actions/checkout@v3
- name: Install toolchain
uses: dtolnay/rust-toolchain@v1
with:
toolchain: ${{ matrix.channel }}
- name: Cache build artifacts
uses: Swatinem/rust-cache@v2
- name: cargo build
run: cargo build
run: cargo build --all-targets
- name: cargo test
run: cargo test
run: cargo test --all-targets