Skip to content

Commit

Permalink
chore: add secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharmath committed Nov 11, 2024
1 parent 28bdd99 commit 2f3c8ab
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
name: Build and Test
env:
RUSTFLAGS: -Dwarnings
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
on:
push:
branches:
Expand Down Expand Up @@ -49,5 +50,10 @@ 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:
- name: Release Plz
uses: MarcoIeni/[email protected]
13 changes: 9 additions & 4 deletions workspace/gh-workflow-gen/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ use gh_workflow_release_plz::ReleasePlz;
use toolchain::Toolchain;

fn main() {
let flags = RustFlags::deny("warnings");

let job = Job::new("Build and Test")
.add_step(Step::checkout())
.add_step(
Expand All @@ -28,8 +30,7 @@ fn main() {
.nightly()
.args("--all-features --workspace -- -D warnings")
.name("Cargo Clippy"),
)
.add_step(ReleasePlz::default());
);

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

let flags = RustFlags::deny("warnings");
let release = Job::new("Release")
.add_step(ReleasePlz::default())
.needs("build");

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

0 comments on commit 2f3c8ab

Please sign in to comment.