- Notifications
You must be signed in to change notification settings - Fork0
DXHeroes/gh-action-auto-release
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Time to implement: 10 minutes.
Saved time: 1 hour per each release of any technology.
This GitHub Action will automatically create a release and publish your package to the supported package registry.
This action usesrelease-please under the hood. It will create a pull request with the release notes and you can check them before merging.
When you merge the pull request, it will create a release with the release notes from the pull request.
Each release will be tagged with a version from the commit message. You can useconventional commits or just add a version number to the commit message.
Every release will be published to the supported package registry.
You can get your package published in a few minutes and you won't have to worry about it anymore. Just follow the instructions below and you're done.
- ✅ node
- ✅ php
- ✅ ruby
- 🛠️ .NET
- 🛠️ dart
- 🛠️ elixir
- 🛠️ go
- 🛠️ helm
- 🛠️ java
- 🛠️ maven
- 🛠️ krm-blueprint
- 🛠️ maven
- 🛠️ expo
- 🛠️ ocaml
- 🛠️ python
- 🛠️ rust
- 🛠️ sfdx
- 🛠️ simple
- 🛠️ terraform-module
You must allow GitHub actions to create and approve pull requests. You can do this in theorganization or repository settings.
- Organization:https://github.com/organizations/YOUR_ORG/settings/actions (replace YOUR_ORG with your organization name) > Workflow permissions > check "Allow GitHub Actions to create and approve pull requests".
- Personal repository:https://github.com/YOUR_OWNER/YOUR_REPO/settings/actions (replace YOUR_OWNER with your GitHub username and YOUR_REPO with your repository name) > Workflow permissions > check "Allow GitHub Actions to create and approve pull requests"..
Add these secret to your repository:
- name:NPM_TOKEN - NPM token with write access to the package.
- Required permissions for Granular Access Token: Packages and scopes > 'Read and write'.
- Required permissions for Classic Token: 'Automation'.
Add these secrets to your repository:
- name:PACKAGIST_USERNAME - Packagist username.
- name:PACKAGIST_TOKEN - Packagist token with write access to the package.
Add these secret to your repository:
- name:RUBYGEMS_API_KEY - RubyGems API key with write access to the package.
- Required scope: 'Push rubygem'.
Create a new file in your repository.github/workflows/release.yml
with the following content that fits your package type.
name:Releaseon:push:branches: -main# set your default branchpermissions:contents:writepull-requests:writejobs:release:name:Release by DX Heroesruns-on:ubuntu-lateststeps: -uses:actions/checkout@v3 -uses:dxheroes/gh-action-auto-release@v1with:release-type:nodepackage-name:prs-test-js-lib# replace with your package nameenv:NPM_TOKEN:${{ secrets.NPM_TOKEN }}
name:Releaseon:push:branches: -main# set your default branchpermissions:contents:writepull-requests:writejobs:release:name:Release by DX Heroesruns-on:ubuntu-lateststeps: -uses:actions/checkout@v3 -uses:dxheroes/gh-action-auto-release@v1with:release-type:phppackage-name:prs-test-php-libenv:PACKAGIST_USERNAME:${{ secrets.PACKAGIST_USERNAME }}PACKAGIST_TOKEN:${{ secrets.PACKAGIST_TOKEN }}
name:Releaseon:push:branches: -main# set your default branchpermissions:contents:writepull-requests:writejobs:release:name:Release by DX Heroesruns-on:ubuntu-lateststeps: -uses:actions/checkout@v3 -uses:dxheroes/gh-action-auto-release@v1with:release-type:rubypackage-name:prs-test-ruby-libenv:RUBYGEMS_API_KEY:${{ secrets.RUBYGEMS_API_KEY }}
release-type
- Type of the release. Default:node
package-name
- Name of the package. Required.- You can also set other
release-please
arguments. Seerelease-please documentation for more information.
Just add this env variable to your workflow:
env:SLACK_WEBHOOK_URL:${{ secrets.SLACK_WEBHOOK_URL }}
Please request other platforms in the issues
Example of setting up Slack notifications for node.js package:
name:Releaseon:push:branches: -main# set your default branchpermissions:contents:writepull-requests:writejobs:release:name:Release by DX Heroesruns-on:ubuntu-lateststeps: -uses:actions/checkout@v3 -uses:dxheroes/gh-action-auto-release@v1with:release-type:nodepackage-name:prs-test-js-lib# replace with your package nameenv:NPM_TOKEN:${{ secrets.NPM_TOKEN }}SLACK_WEBHOOK_URL:${{ secrets.SLACK_WEBHOOK_URL }}## Configure SLACK_WEBHOOK_URL
Setworking-directory
to the path of the package. For example:
name:Releaseon:push:branches: -main# set your default branchpermissions:contents:writepull-requests:writejobs:release:name:Release by DX Heroesruns-on:ubuntu-latestdefaults:run:working-directory:libraries/js-lib# replace with your package pathsteps:# ...
All contributions are welcome. Please create an issue or submit a pull request.
About
This GitHub action automatically creates a release in a PR and, after merging, publishes your package to the supported package registry and notifies you of the release in Slack.
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.