Skip to content

Commit

Permalink
Improve documentation by recommending the usage of bash in GitHub Act…
Browse files Browse the repository at this point in the history
…ion with dotnet-releaser
  • Loading branch information
xoofx committed Mar 1, 2022
1 parent 79c1ad6 commit f949859
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@ jobs:

- name: Self Build - Publish (main only)
if: github.event_name == 'push'
shell: bash
run: |
./src/dotnet-releaser/bin/Debug/net6.0/dotnet-releaser run --nuget-token "${{secrets.NUGET_TOKEN != '' && secrets.NUGET_TOKEN || 'no_token'}}" --github-token "${{secrets.GITHUB_TOKEN}}" src/dotnet-releaser.toml
./src/dotnet-releaser/bin/Debug/net6.0/dotnet-releaser run --nuget-token "${{secrets.NUGET_TOKEN}}" --github-token "${{secrets.GITHUB_TOKEN}}" src/dotnet-releaser.toml
10 changes: 7 additions & 3 deletions doc/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,9 @@ In order to use `dotnet-releaser` on your GitHub CI, you need:
```
4. To run the dotnet-releaser command assuming that you have added all the secret tokens to your GitHub repository
```sh
dotnet-releaser run --nuget-token "${{secrets.NUGET_TOKEN != '' && secrets.NUGET_TOKEN || 'no_token'}}" --github-token "${{secrets.GITHUB_TOKEN}}" src/dotnet-releaser.toml
dotnet-releaser run --nuget-token "${{secrets.NUGET_TOKEN}}" --github-token "${{secrets.GITHUB_TOKEN}}" src/dotnet-releaser.toml
```
It is recommended to use `shell: bash` on GitHub Action so that if a secrets token is empty, bash won't remove the quotes, [unlike pwsh](https://github.com/PowerShell/PowerShell/issues/1995).

Depending on the kind of GitHub event, the run command will automatically:

Expand All @@ -187,13 +188,16 @@ An example of a setup with GitHub Actions:
dotnet-version: '6.0.x'

- name: Build, Tests, Cover, Pack and Publish (on push tag)
shell: bash
run: |
dotnet tool install --global dotnet-releaser
dotnet-releaser run --nuget-token "${{secrets.NUGET_TOKEN != '' && secrets.NUGET_TOKEN || 'no_token'}}" --github-token "${{secrets.GITHUB_TOKEN}}" src/dotnet-releaser.toml
dotnet-releaser run --nuget-token "${{secrets.NUGET_TOKEN}}" --github-token "${{secrets.GITHUB_TOKEN}}" src/dotnet-releaser.toml
```
> **NOTE about tokens:**
>
>
> It is recommended to use `shell: bash` on GitHub Action so that if a secrets token is empty, bash won't remove the quotes, [unlike pwsh](https://github.com/PowerShell/PowerShell/issues/1995).
>
> In order to publish changelogs, NuGet and app packages to NuGet and GitHub, you need to specify secrets tokens:
>
> - `${{secrets.GITHUB_TOKEN}}` is available by default on GitHub Action and allow to interact directly with your repository. Nothing to create here. Unless you are going to publish an application to a separate Homebrew repository, and in that case you need to create an extra token. See [Homebrew documentation](#29-homebrew) for more details.
Expand Down
4 changes: 3 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,12 @@ By default, `dotnet-releaser` will:
dotnet-version: '6.0.x'

- name: Build, Tests, Cover, Pack and Publish (on push tag)
shell: bash
run: |
dotnet tool install --global dotnet-releaser
dotnet-releaser run --nuget-token "${{secrets.NUGET_TOKEN != '' && secrets.NUGET_TOKEN || 'no_token'}}" --github-token "${{secrets.GITHUB_TOKEN}}" src/dotnet-releaser.toml
dotnet-releaser run --nuget-token "${{secrets.NUGET_TOKEN}}" --github-token "${{secrets.GITHUB_TOKEN}}" src/dotnet-releaser.toml
```
Notice the recommended usage of `shell: bash` so that if a secrets token is empty, bash won't remove the quotes, [unlike pwsh](https://github.com/PowerShell/PowerShell/issues/1995).

See the user guide below for further details on how to use `dotnet-releaser`.

Expand Down

0 comments on commit f949859

Please sign in to comment.