Skip to content

Commit

Permalink
Merge branch 'main' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
bakerkretzmar committed Oct 12, 2023
2 parents 28ae2e4 + c53c891 commit 9c6255d
Show file tree
Hide file tree
Showing 15 changed files with 95 additions and 13 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish
on:
release:
types: [published]
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Set up .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://registry.npmjs.org
- run: npm ci
# Get the 'version' field out of the package.json file
- name: Get package.json version
id: package-json-version
run: echo "version=$(cat package.json | jq '.version' --raw-output)" >> $GITHUB_OUTPUT
# Abort if the version in the package.json file (prefixed with 'v') doesn't match the tag name of the release
- name: Check package.json version against tag name
if: format('v{0}', steps.package-json-version.outputs.version) != github.event.release.tag_name
uses: actions/github-script@v3
with:
script: core.setFailed('Release tag does not match package.json version!')
# Abort if this is a pre-release and the version in the package.json file doesn't contain a '-' to indicate that (e.g. v2.0.0-beta.1), or vice-versa
- name: Check package.json version against pre-release
if: contains(steps.package-json-version.outputs.version, '-') != github.event.release.prerelease
uses: actions/github-script@v3
with:
script: core.setFailed('Stability of release tag does not match package.json version!')
# If this is a pre-release, publish it to NPM under the 'next' tag (default is 'latest')
- run: npm publish ${{ github.event.release.prerelease && '--tag next' || '' }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ Breaking changes are marked with ⚠️.

## [Unreleased]

## [v1.8.1] - 2023-10-12

**Fixed**

- Update: Correction of some spellings and articles in the Readme file. by @prince-noman in https://github.com/tighten/ziggy/pull/678
- Fix `route().current()` with encoded characters by @bakerkretzmar in https://github.com/tighten/ziggy/pull/668

**Changed**

- Update Readme, formatting, and testing setup by @bakerkretzmar in https://github.com/tighten/ziggy/pull/675

## [v1.8.0] - 2023-10-06

**Added**
Expand Down Expand Up @@ -305,7 +316,8 @@ Breaking changes are marked with ⚠️.

For previous changes see the [Releases](https://github.com/tighten/ziggy/releases) page.

[Unreleased]: https://github.com/tighten/ziggy/compare/v1.8.0...HEAD
[Unreleased]: https://github.com/tighten/ziggy/compare/v1.8.1...HEAD
[v1.8.1]: https://github.com/tighten/ziggy/compare/v1.8.0...v1.8.1
[v1.8.0]: https://github.com/tighten/ziggy/compare/v1.7.0...v1.8.0
[v1.7.0]: https://github.com/tighten/ziggy/compare/v1.6.2...v1.7.0
[v1.6.2]: https://github.com/tighten/ziggy/compare/v1.6.1...v1.6.2
Expand Down
15 changes: 15 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,21 @@ To test the type definitions, open `tests/js/types.ts` in an editor or IDE with

See also [`tighten/ziggy-type-testing`](https://github.com/tighten/ziggy-type-testing).

## Releases

> [!NOTE]
> Ziggy publishes two different versions of its built assets to Packagist and NPM (the NPM build does not bundle in our external NPM dependencies). The ones that live in the repo are for Composer/Packagist, and the ones for NPM are built automatically when running `npm publish` and can be reverted/deleted after publishing.
To create and release a new version of Ziggy:

- Update the `version` field in `package.json` to the new version number **not prefixed with `v`** (e.g. `2.1.0`).
- Update the Changelog.
- Rebuild Ziggy's assets with `npm run build && npm run build:vue && npm run build:react`.
- Commit these changes and push them to the `main` branch.
- Create and publish a new release on GitHub, creating a new tag targeting the `main` branch, named with the version number **prefixed with `v`** (e.g. `v2.1.0`).
- This will trigger a run of the release workflow in `.github/workflows/release.yml`, which will rebuild Ziggy's assets and publish the new version to NPM.
- For alpha/beta versions, use an appropriate suffix (e.g. `-beta.1`, for a version of `3.0.0-beta.1`/`v3.0.0-beta.1`) and mark the GitHub release as a pre-release. Pre-releases are published to NPM under the `next` tag, so they are not installed by default and must be explicitly requested with `npm install ziggy-js@next`.

## Requirements

- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](https://github.com/squizlabs/PHP_CodeSniffer).
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ export default function PostsLink() {
}
```

You can slo make the `Ziggy` config object available globally, so you can call `useRoute()` without passing Ziggy's configuration to it every time:
You can also make the `Ziggy` config object available globally, so you can call `useRoute()` without passing Ziggy's configuration to it every time:

```js
// app.js
Expand Down Expand Up @@ -598,4 +598,4 @@ Please review our [security policy](../../security/policy) on how to report secu
## License
Ziggy is open source software released under the MIT license. See [LICENSE](LICENSE) for more information.
Ziggy is open-source software released under the MIT license. See [LICENSE](LICENSE) for more information.
2 changes: 1 addition & 1 deletion dist/index.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.m.js

Large diffs are not rendered by default.

Loading

0 comments on commit 9c6255d

Please sign in to comment.