Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

Commit

Permalink
fix(workflow): update workflow to tag releases
Browse files Browse the repository at this point in the history
Updated to get release-please workflow to manage tags for major and major.minor
  • Loading branch information
peterjokumsen committed Dec 20, 2022
1 parent d94ef65 commit 001a06d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
13 changes: 0 additions & 13 deletions .github/workflows/on-release.yml

This file was deleted.

20 changes: 18 additions & 2 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,24 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: node
package-name: dotnet-sonar-scanner
extra-files: |
README.md
command: github-release

- uses: actions/checkout@v3
- name: tag major and minor versions
if: ${{ steps.release.outputs.release_created }}
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/chill-viking/dotnet-sonar-scanner.git"
git tag -d v${{ steps.release.outputs.major }} || true
git tag -d v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
git push origin :v${{ steps.release.outputs.major }} || true
git push origin :v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
git tag -a v${{ steps.release.outputs.major }} -m "Release v${{ steps.release.outputs.major }}"
git tag -a v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} -m "Release v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}"
git push origin v${{ steps.release.outputs.major }}
git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ GitHub Action to scan a dotnet project using sonar scanner.

This action will check out your code (by default) and execute `dotnet build` and `dotnet test` in the root directory.

This directory used can be changed by specifying the [input](#inputs) `working-directory`.
The directory used can be changed by specifying the [input](#inputs) `working-directory`.

The directory used should have a single solution `.sln` file containing the projects being tested and optionally test projects to run against the projects.

Expand All @@ -38,7 +38,7 @@ jobs:
runs-on: ubuntu-latest
name: dotnet test coverage update
steps:
- uses: chill-viking/dotnet-sonar-scanner@v1
- uses: chill-viking/dotnet-sonar-scanner@v2
name: Scan and Publish
with:
sonar-project-key: '{sonar-project-key}'
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
# preform additional steps with repo checked out
- uses: chill-viking/dotnet-sonar-scanner@v1
- uses: chill-viking/dotnet-sonar-scanner@v2
name: Scan and Publish
with:
sonar-project-key: '{sonar-project-key}'
Expand Down

0 comments on commit 001a06d

Please sign in to comment.