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 uses release-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 use conventional 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 the organization 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: Release
on:
push:
branches:
- main # set your default branch
permissions:
contents: write
pull-requests: write
jobs:
release:
name: Release by DX Heroes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dxheroes/gh-action-auto-release@v1
with:
release-type: node
package-name: prs-test-js-lib # replace with your package name
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
name: Release
on:
push:
branches:
- main # set your default branch
permissions:
contents: write
pull-requests: write
jobs:
release:
name: Release by DX Heroes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dxheroes/gh-action-auto-release@v1
with:
release-type: php
package-name: prs-test-php-lib
env:
PACKAGIST_USERNAME: ${{ secrets.PACKAGIST_USERNAME }}
PACKAGIST_TOKEN: ${{ secrets.PACKAGIST_TOKEN }}
name: Release
on:
push:
branches:
- main # set your default branch
permissions:
contents: write
pull-requests: write
jobs:
release:
name: Release by DX Heroes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dxheroes/gh-action-auto-release@v1
with:
release-type: ruby
package-name: prs-test-ruby-lib
env:
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. See release-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: Release
on:
push:
branches:
- main # set your default branch
permissions:
contents: write
pull-requests: write
jobs:
release:
name: Release by DX Heroes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dxheroes/gh-action-auto-release@v1
with:
release-type: node
package-name: prs-test-js-lib # replace with your package name
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} ## Configure SLACK_WEBHOOK_URL
Set working-directory
to the path of the package. For example:
name: Release
on:
push:
branches:
- main # set your default branch
permissions:
contents: write
pull-requests: write
jobs:
release:
name: Release by DX Heroes
runs-on: ubuntu-latest
defaults:
run:
working-directory: libraries/js-lib # replace with your package path
steps:
# ...
All contributions are welcome. Please create an issue or submit a pull request.