Skip to content

Commit

Permalink
ci: add release into the build job
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharmath committed Nov 11, 2024
1 parent 04bf5ad commit 006000c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,8 @@ jobs:
run: cargo +nightly fmt --check
- name: Cargo Clippy
run: cargo +nightly clippy --all-features --workspace -- -D warnings
release:
needs: build
name: Release
runs-on: ubuntu-latest
steps:
- run: find . -name Cargo.toml
- name: Release Plz
uses: MarcoIeni/[email protected]
with:
command: release-pr
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11 changes: 3 additions & 8 deletions workspace/gh-workflow-gen/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ fn main() {
.nightly()
.args("--all-features --workspace -- -D warnings")
.name("Cargo Clippy"),
);
)
.add_step(Step::run("find . -name Cargo.toml"))
.add_step(ReleasePlz::default().command(Command::ReleasePR));

let event = Event::default()
.push(Push::default().add_branch("main"))
Expand All @@ -42,18 +44,11 @@ fn main() {
.add_branch("main"),
);

let release = Job::new("Release")
.add_github_token()
.add_step(Step::run("find . -name Cargo.toml"))
.add_step(ReleasePlz::default().command(Command::ReleasePR))
.needs("build");

Workflow::new("Build and Test")
.add_env(flags)
.permissions(Permissions::read())
.on(event)
.add_job("build", job)
.add_job("release", release)
.generate()
.unwrap();
}

0 comments on commit 006000c

Please sign in to comment.