-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d1f3cbf
commit f829b2b
Showing
1 changed file
with
69 additions
and
0 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,69 @@ | ||
name: New Release | ||
|
||
on: | ||
milestone: | ||
types: [closed] | ||
|
||
jobs: | ||
create-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Get Project Version | ||
id: get_version | ||
uses: mod-posh/[email protected] | ||
with: | ||
Filename: 'TerraformRegistryClient/${{ vars.PROJECT_NAME }}.csproj' | ||
verbose: "verbose" | ||
|
||
- name: Create Release Notes | ||
uses: mod-posh/[email protected] | ||
with: | ||
milestone_number: ${{ github.event.milestone.number }} | ||
verbose: 'verbose' | ||
github_token: ${{ secrets.PAT }} | ||
|
||
- name: Pull Latest Changes | ||
run: git pull origin ${{ github.ref_name }} | ||
shell: bash | ||
|
||
- name: Create Release | ||
uses: mod-posh/[email protected] | ||
with: | ||
name: 'Release v${{ env.VERSION }}' | ||
filename: 'RELEASE.md' | ||
version: ${{ env.VERSION }} | ||
verbose: 'verbose' | ||
github_token: ${{ secrets.PAT }} | ||
|
||
- name: Install XMLDocMD Tool | ||
run: dotnet tool install --global xmldocmd | ||
|
||
- name: Build Project | ||
run: dotnet build ${{ vars.PROJECT_NAME }}/${{ vars.PROJECT_NAME }}.csproj --configuration Release | ||
|
||
- name: Publish Project | ||
run: dotnet publish ${{ vars.PROJECT_NAME }}/${{ vars.PROJECT_NAME }}.csproj --configuration Release --output ./publish | ||
|
||
- name: Generate Documentation | ||
run: | | ||
xmldocmd ./publish/${{ vars.PROJECT_NAME }}.dll Docs --visibility private --clean --namespace ${{ vars.PROJECT_NAMESPACE }} --namespace-pages | ||
env: | ||
PATH: ${{ github.runner.tool_cache }}/.dotnet/tools:$PATH:~/.dotnet/tools | ||
|
||
- name: Run markdownlint-cli2-action | ||
uses: DavidAnson/markdownlint-cli2-action@v16 | ||
with: | ||
globs: '**/*.md' | ||
fix: true | ||
|
||
- name: Commit Documentation Changes | ||
run: | | ||
git config --local user.name "github-actions[bot]" | ||
git config --local user.email "github-actions[bot]@users.noreply.github.com" | ||
git add Docs/ | ||
git commit -m "Update documentation for release v${{ env.VERSION }}" | ||
git push origin ${{ github.ref_name }} | ||
if: success() |