Releasing | laravel-csp-rust | Spatie       

 SPATIE  

laravel-csp-rust
================

spatie.be/open-source

  [Docs](https://spatie.be/docs)  [Laravel-csp-rust](https://spatie.be/docs/laravel-csp-rust/v1)  Releasing

 Version   v1      

 Other versions for crawler [v1](https://spatie.be/docs/laravel-csp-rust/v1) 

  Releasing    
- [ Introduction ](https://spatie.be/docs/laravel-csp-rust/v1/introduction)
- [ Support us ](https://spatie.be/docs/laravel-csp-rust/v1/support-us)
- [ Installation and setup ](https://spatie.be/docs/laravel-csp-rust/v1/installation-and-setup)
- [ Usage ](https://spatie.be/docs/laravel-csp-rust/v1/usage)
- [ Creating a preset ](https://spatie.be/docs/laravel-csp-rust/v1/creating-a-preset)
- [ Using inline scripts and styles ](https://spatie.be/docs/laravel-csp-rust/v1/using-inline-scripts-and-styles)
- [ Outputting a CSP policy as a meta tag ](https://spatie.be/docs/laravel-csp-rust/v1/outputting-a-csp-policy-as-a-meta-tag)
- [ Reporting CSP errors ](https://spatie.be/docs/laravel-csp-rust/v1/reporting-csp-errors)
- [ Testing ](https://spatie.be/docs/laravel-csp-rust/v1/testing)
- [ Changelog ](https://spatie.be/docs/laravel-csp-rust/v1/changelog)
- [ Releasing ](https://spatie.be/docs/laravel-csp-rust/v1/releasing)

 Releasing
=========

###  On this page 

1. [ Set up each generated crate ](#content-set-up-each-generated-crate)
2. [ Release a patch ](#content-release-a-patch)

Set up each generated crate
-----------------------------------------------------------------------------------------------------------------------------------------

The first release is `0.1.0` and requires Freek's explicit approval. Before that approval request, remove the development-only package-tools patch after its Laravel 0.1.4 update has been released, rerun all checks with registry dependencies, and require green CI. Never publish from a checkout that relies on a dependency override.

The configurator creates `.github/workflows/release.yml` for `spatie-laravel-csp` and runs `scripts/setup-github.py`. The skeleton only contains a `.stub` template and must not be published.

GitHub CLI must be authenticated with Administration write access to `spatie/laravel-csp-rust`, including organization approval when required. The setup command checks that Git `origin` matches this repository, enables Discussions, disables Projects and Wiki, and creates the protected `release` environment. It verifies reviewer `freekmurze` (483853), administrator bypass disabled, and exactly one custom tag rule, `v*`. Existing environment settings are never overwritten, even when they do not match. Configuration exits nonzero on incomplete setup but keeps the generated package, and prints remaining steps and settings links.

For offline/CI configuration use `--no-github`. Retry later with `python3 scripts/setup-github.py`. Review existing conflicts at https://github.com/spatie/laravel-csp-rust/settings/environments and features at https://github.com/spatie/laravel-csp-rust/settings. No credential is written into generated files.

1. If the crate does not exist on crates.io, make an explicitly authorized initial manual publication with a crates.io API token. Trusted publishing cannot create a new crate. The workflow also requires an existing stable registry version.
2. At https://crates.io/crates/spatie-laravel-csp/settings, add a GitHub trusted publisher with repository owner `spatie`, repository name `laravel-csp-rust`, workflow filename `release.yml`, and environment `release`. Use the actual generated repository, not the skeleton repository. Every generated crate needs its own trusted publisher. This step is manual because the crate must exist first.
3. Confirm GitHub setup succeeded. If access was refused or protections conflict, ask an administrator to review the linked environment settings. Require reviewer `freekmurze`, disable administrator bypass, and use a custom deployment policy allowing only tags matching `v*`, not branches. Self-review may remain allowed. Environment protections are not copied by GitHub's template feature; the setup command creates them.
4. Require green CI on `main` and review the package contents with `cargo package --list`. Keep Cargo.lock committed. If the manifest has `publish = false`, leave it disabled until publication is explicitly authorized, then remove it before the initial publication.

No long-lived registry token is needed in GitHub Actions. Only the publish job has `id-token: write`; `rust-lang/crates-io-auth-action@v1` exchanges OIDC credentials for a short-lived crates.io token after validation, tests and a dry run succeed.

The job also uses `actions: read` to verify the environment through GitHub's API before authentication. It requires a reviewer, administrator bypass disabled, and exactly one custom deployment policy, a tag rule named `v*`. Missing protections, extra branch or tag rules, and API access failures stop the release. If your credential cannot create these protections, an administrator must configure them manually or provide a credential with Administration write access. Do not release until setup is complete; the workflow does not create protections for you.

Release a patch
-----------------------------------------------------------------------------------------------------

After release authorization, update Cargo.toml, Cargo.lock and CHANGELOG.md, run the documented checks, and merge to `main`. Tag that reviewed commit with `v` followed by its exact manifest version, then push the tag and approve the protected environment deployment.

The workflow permits only the next stable patch of the highest stable version returned by crates.io, including yanked versions. After `0.1.0`, only `v0.1.1` is allowed. It rejects major or minor bumps, skipped or repeated patches, prereleases, build metadata, tag/manifest mismatches and commits outside `main` before authentication or publication. Registry lookup failures, missing crates and crates without stable versions also stop the workflow. There is no manual dispatch trigger.

Never make minor or major version bumps for this package. Subsequent releases are patch-only.

 A good
match?
-------------

### What we do best

- All things Laravel
- Custom frontend components
- Building APIs
- AI-powered features
- Simplifying things
- Clean solutions
- Integrating services

### Not our cup of tea

- WordPress themes
- Cutting corners
- Free mockups to win a job
- "Just execute the briefing"

 In short: we'd like to be a **substantial part** of your project.

 [ Get in touch via email ](mailto:info@spatie.be?subject=A%20good%20match%21&body=Tell%20us%20as%20much%20as%20you%20can%20about%0A-%20your%20online%20project%0A-%20your%20planning%0A-%20your%20budget%0A-%20%E2%80%A6%0A%0AAnything%20that%20helps%20us%20to%20start%20straightforward%21)
