Skip to content

Commit

Permalink
Sync repo templates ⚙
Browse files Browse the repository at this point in the history
  • Loading branch information
coreosbot committed May 31, 2023
1 parent e453e3b commit 5b4ff51
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 32 deletions.
6 changes: 5 additions & 1 deletion .copr/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Maintained in https://github.com/coreos/repo-templates
# Do not edit downstream.

.PHONY: srpm
srpm:
dnf install -y git rust-packaging rpm-build rpmdevtools
dnf install -y git rpm-build rpmdevtools rust-packaging
# similar to https://github.com/actions/checkout/issues/760, but for COPR
git config --global --add safe.directory '*'
curl -LOf https://src.fedoraproject.org/rpms/rust-afterburn/raw/rawhide/f/rust-afterburn.spec
Expand All @@ -9,5 +12,6 @@ srpm:
sed -ie "s,^Version:.*,Version: $$version," rust-afterburn.spec
sed -ie 's/^Patch/# Patch/g' rust-afterburn.spec # we don't want any downstream patches
sed -ie 's/^Source1/# Source1/g' rust-afterburn.spec # we don't vendor
spectool -g rust-afterburn.spec # download any remaining sources (e.g. coreos-installer-dracut)
rpmbuild -bs --define "_sourcedir ${PWD}" --define "_specdir ${PWD}" --define "_builddir ${PWD}" --define "_srcrpmdir ${PWD}" --define "_rpmdir ${PWD}" --define "_buildrootdir ${PWD}/.build" rust-afterburn.spec
mv *.src.rpm $$outdir
9 changes: 5 additions & 4 deletions .github/ISSUE_TEMPLATE/release-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ Push access to the upstream repository is required in order to publish the new t

- make sure the project is clean and prepare the environment:
- [ ] Make sure `cargo-release` and `cargo-vendor-filterer` are up to date: `cargo install cargo-release cargo-vendor-filterer`
- [ ] `cargo test --all-features`
- [ ] `cargo vendor-filterer target/vendor`
- [ ] `cargo test --all-features --config 'source.crates-io.replace-with="vv"' --config 'source.vv.directory="target/vendor"'`
- [ ] `cargo clean`
- [ ] `git clean -fd`
- [ ] `RELEASE_VER=x.y.z`
Expand Down Expand Up @@ -87,13 +88,13 @@ Push access to the upstream repository is required in order to publish the new t
- [ ] run `kinit your_fas_account@FEDORAPROJECT.ORG`
- [ ] run `fedpkg new-sources $(spectool -S rust-afterburn.spec | sed 's:.*/::')`
- [ ] PR the changes in [Fedora](https://src.fedoraproject.org/rpms/rust-afterburn)
- [ ] once the PR merges to rawhide, merge rawhide into the other relevant branches (e.g. f35) then push those, for example:
- [ ] once the PR merges to rawhide, merge rawhide into the other relevant branches (e.g. f38) then push those, for example:
```bash
git checkout rawhide
git pull --ff-only
git checkout f35
git checkout f38
git merge --ff-only rawhide
git push origin f35
git push origin f38
```
- [ ] on each of those branches run `fedpkg build`
- [ ] once the builds have finished, submit them to [bodhi](https://bodhi.fedoraproject.org/updates/new), filling in:
Expand Down
19 changes: 11 additions & 8 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,10 +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
- skip-notes
- package-ecosystem: cargo
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 10
labels:
- dependency
- skip-notes
11 changes: 9 additions & 2 deletions .github/workflows/rpm.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
# Maintained in https://github.com/coreos/repo-templates
# Do not edit downstream.

name: RPMs
on:
push:
Expand All @@ -8,6 +10,11 @@ on:
permissions:
contents: read

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

jobs:
test-rpm-build:
name: "Build (Fedora)"
Expand All @@ -19,7 +26,7 @@ jobs:
# need to install git before checkout to get a git repo
- name: Install packages
run: dnf install -y git make mock
- name: Checkout repository
- name: Check out repository
uses: actions/checkout@v3
# fetch tags for versioning
with:
Expand Down
49 changes: 32 additions & 17 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
# Maintained in https://github.com/coreos/repo-templates
# Do not edit downstream.

name: Rust
on:
push:
Expand All @@ -8,91 +10,104 @@ on:
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.67.0
ACTIONS_LINTS_TOOLCHAIN: 1.69.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
- name: cargo test
run: cargo test
tests-release-stable:
name: "Tests (release), stable toolchain"
name: Tests (release), 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 (release)
run: cargo build --release
- name: cargo test (release)
run: cargo test --release
tests-release-msrv:
name: "Tests (release), minimum supported toolchain"
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
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: Cache build artifacts
uses: Swatinem/rust-cache@v2
- name: cargo build (release)
run: cargo build --release
- name: cargo test (release)
run: cargo test --release
linting:
name: "Lints, pinned toolchain"
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
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
- name: cargo test
Expand Down

0 comments on commit 5b4ff51

Please sign in to comment.