-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from amtrack/fixes
overhaul
- Loading branch information
Showing
7 changed files
with
158 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
default: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 14 | ||
- name: Install dependencies | ||
run: yarn | ||
- name: Release package | ||
run: npx semantic-release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
package.json | ||
/.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,91 @@ | ||
# semantic-release-sfdx | ||
|
||
Set of [semantic-release](https://github.com/semantic-release/semantic-release) plugins for publishing an SFDX package | ||
> [semantic-release](https://github.com/semantic-release/semantic-release) plugin for publishing an SFDX package | ||
## Prerequisites | ||
|
||
You must have SFDX installed and connected to your DevHub (see Authorization in the [Salesforce DX Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_auth.htm)). | ||
|
||
## Configuration | ||
|
||
To enable this plugin, simply add the following to your `package.json` or [release configuration file](https://semantic-release.gitbook.io/semantic-release/usage/configuration). | ||
|
||
```json | ||
{ | ||
"release": { | ||
"verifyConditions": "semantic-release-sfdx", | ||
"publish": { | ||
"devhubusername": "MyDevHub" | ||
} | ||
"plugins": ["semantic-release-sfdx"] | ||
} | ||
} | ||
``` | ||
## Windows Support Disclaimer | ||
Currently this plugin will only runs in *nix systems, as it uses shell scripts to log into google cloud. If you need Windows support Pull-requests are welcome. | ||
|
||
### DevHub | ||
|
||
## Configuration | ||
By default this plugin uses the DevHub which is set in your `defaultdevhubusername` sfdx config. | ||
|
||
To use another DevHub, set the environment variable `SFDX_DEFAULTDEVHUBUSERNAME` (see [Salesforce CLI Setup Guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_dev_cli_env_variables.htm)). | ||
|
||
### Advanced Configuration | ||
|
||
You must have SFDX installed and connected to your dev hub | ||
**static config via `package.json`** | ||
|
||
## Plugins | ||
```json | ||
{ | ||
"release": { | ||
"plugins": [ | ||
[ | ||
"semantic-release-sfdx", | ||
{ | ||
"codecoverage": true, | ||
"promote": true, | ||
"installationkey": "mysecretkey" | ||
} | ||
] | ||
] | ||
} | ||
} | ||
``` | ||
|
||
**dynamic config via `release.config.js`** | ||
|
||
```javascript | ||
module.exports = { | ||
plugins: [ | ||
[ | ||
'semantic-release-sfdx', | ||
{ | ||
codecoverage: process.env.PROMOTE_PACKAGE_VERSION === 'true', | ||
promote: process.env.PROMOTE_PACKAGE_VERSION === 'true', | ||
installationkey: process.env.INSTALLATIONKEY, | ||
}, | ||
], | ||
], | ||
} | ||
``` | ||
|
||
### `verifyConditions` | ||
|
||
Verify that all needed configuration is present and login to the dev hub | ||
To disable the verification of your SFDX project, DevHub and installationkey: | ||
|
||
```json | ||
{ | ||
"release": { | ||
"plugins": [ | ||
"semantic-release-sfdx", | ||
{ | ||
"verifyConditions": false | ||
} | ||
] | ||
} | ||
} | ||
``` | ||
|
||
## Example | ||
|
||
### `publish` | ||
See a second generation package being released with this plugin [here](https://github.com/mdapi-issues/managed-package-2nd-gen-dummy). | ||
|
||
Tag the image specified by `name` with the new version, create ne package version and update the `latest` tag. | ||
- [package.json](https://github.com/mdapi-issues/managed-package-2nd-gen-dummy/blob/main/.github/workflows/default.yml) | ||
- [GitHub Actions configuration](https://github.com/mdapi-issues/managed-package-2nd-gen-dummy/blob/main/package.json) | ||
|
||
## Credits | ||
|
||
Thanks to https://github.com/carlos-cubas/semantic-release-gcp.git for kicking off point | ||
Thanks to https://github.com/carlos-cubas/semantic-release-gcp.git for kicking off point |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters