Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add release workflow #874

Merged
merged 2 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: release
on: workflow_dispatch
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Verify branch name
if: github.ref != 'refs/heads/master'
run: |
echo "🚨 The release must start from the master branch!"
exit 1

- name: Configure releaser details
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"

- name: Install pnpm
uses: wyvox/action-setup-pnpm@v3
with:
pnpm-version: 8.5.1
node-version: 18.x
node-registry-url: "https://registry.npmjs.org"

- name: Trigger release script
run: pnpm run release
michelegera marked this conversation as resolved.
Show resolved Hide resolved
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
40 changes: 6 additions & 34 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,12 @@
# Release Process

Releases are mostly automated using
Releases are automated using
[release-it](https://github.com/release-it/release-it/) and
[conventional-changelog](https://github.com/release-it/conventional-changelog).

## Release
## How to release

The release process is straightforward:

- First, ensure that you have installed your project’s dependencies:

```sh
pnpm install
```

- Second, ensure that you have obtained a
[GitHub personal access token][generate-token] with the `repo` scope (no
other permissions are needed). Make sure the token is available as the
`GITHUB_AUTH` environment variable.

For instance:

```bash
export GITHUB_AUTH=abc123def456
```

[generate-token]: https://github.com/settings/tokens/new?scopes=repo&description=GITHUB_AUTH+env+variable

- And last (but not least 😁) do your release.

```sh
pnpm release
```

[release-it](https://github.com/release-it/release-it/) manages the actual
release process. It will prompt you to to choose the version number after which
you will have the chance to hand tweak the changelog to be used (for the
`CHANGELOG.md` and GitHub release), then `release-it` continues on to tagging,
pushing the tag and commits, etc.
- [Click here](https://github.com/qonto/ember-phone-input/actions/workflows/release.yml) to visit the page for the `release` Action
- If you have the right **permissions**, you will see a "Run workflow" button, click on it
- Click on "Run workflow" in the dropdown
- The pipeline will release on GitHub and npm for you, enjoy!
Loading