From a3241b3bbb16393305d805d68712a09f851fd989 Mon Sep 17 00:00:00 2001 From: Freek Gruntjes Date: Wed, 1 Feb 2023 16:56:36 +0100 Subject: [PATCH 1/3] fix: Missing package.json for semantic release --- .github/workflows/deploy_release.yaml | 37 +++++++++++++++++++++++++++ .github/workflows/release.yaml | 3 +-- 2 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/deploy_release.yaml diff --git a/.github/workflows/deploy_release.yaml b/.github/workflows/deploy_release.yaml new file mode 100644 index 0000000..560cbd6 --- /dev/null +++ b/.github/workflows/deploy_release.yaml @@ -0,0 +1,37 @@ +name: Deploy release + +on: + release: + types: [ published ] + +jobs: + deploy_slug: + runs-on: ubuntu-latest + steps: + - uses: booxmedialtd/ws-action-parse-semver@v1 + id: semver + with: + input_string: ${{ github.ref }} + version_extractor_regex: "\/v(.*)$" + - id: environment + run: PRERELASE=${{ steps.semver.outputs.prerelease }} echo "var=$([ -z "${PRERELASE}" ] && echo "production" || echo "${PRERELASE}")" >> $GITHUB_OUTPUT + outputs: + environment: ${{ steps.environment.outputs.var }} + tag: v${{ steps.semver.outputs.fullversion }} + + build: + needs: [ deploy_slug ] + uses: ./.github/workflows/build.yaml + secrets: inherit + with: + environment: ${{ needs.deploy_slug.outputs.environment }} + tag: ${{ needs.deploy_slug.outputs.tag }} + + deploy: + needs: [ deploy_slug, build ] + uses: ./.github/workflows/deploy.yaml + secrets: inherit + concurrency: ${{ needs.deploy_slug.outputs.environment }} + with: + environment: ${{ needs.deploy_slug.outputs.environment }} + tag: ${{ needs.deploy_slug.outputs.tag }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index b621545..da83f6e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -17,7 +17,6 @@ jobs: persist-credentials: false - uses: cycjimmy/semantic-release-action@v3 with: - semantic_version: 19 - working_directory: "./.github" + semantic_version: 20 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 098ad8c266bd63e649009ac94a9fe3c3a48ea0cf Mon Sep 17 00:00:00 2001 From: Freek Gruntjes Date: Wed, 1 Feb 2023 17:05:34 +0100 Subject: [PATCH 2/3] chore: Removed PR test result clutter --- .github/workflows/test_unit.yaml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test_unit.yaml b/.github/workflows/test_unit.yaml index dbc791d..0972847 100644 --- a/.github/workflows/test_unit.yaml +++ b/.github/workflows/test_unit.yaml @@ -34,12 +34,7 @@ jobs: with: dotnet-version: 7.0 - run: cd ${{ matrix.project }} && npm ci - - run: cd ${{ matrix.project }} && npm run test -- --reporters="default" --reporters="jest-md-dashboard" - - uses: marocchino/sticky-pull-request-comment@v2 - if: always() - with: - path: ${{ matrix.project }}/test-dashboard.md - header: unit_typescript + - run: cd ${{ matrix.project }} && npm run test -- --reporters="default" test_unit_dotnet: runs-on: ubuntu-latest @@ -59,9 +54,4 @@ jobs: - run: dotnet restore ${{ matrix.project }} - run: dotnet build --no-restore ${{ matrix.project }} - run: docker-compose -f App.Lib.Tests/docker-compose.yaml up -d - - run: dotnet test --no-restore --no-build --logger "liquid.md;LogFileName=${{github.workspace}}/${{env.file_name}};Title=${{env.title}};" ${{ matrix.project }} - - uses: marocchino/sticky-pull-request-comment@v2 - if: always() - with: - path: ${{github.workspace}}/${{env.file_name}} - header: unit_dotnet + - run: dotnet test --no-restore --no-build From a294d63e9f82009790ec7c4533cd1bbcd361cfce Mon Sep 17 00:00:00 2001 From: Freek Gruntjes Date: Wed, 1 Feb 2023 17:06:25 +0100 Subject: [PATCH 3/3] fix: Attempted semantic release fix --- .github/workflows/deploy_release.yaml | 4 ++-- .github/workflows/test_integration.yaml | 12 +++++++++--- .github/workflows/test_unit.yaml | 3 ++- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy_release.yaml b/.github/workflows/deploy_release.yaml index 560cbd6..5b47141 100644 --- a/.github/workflows/deploy_release.yaml +++ b/.github/workflows/deploy_release.yaml @@ -12,9 +12,9 @@ jobs: id: semver with: input_string: ${{ github.ref }} - version_extractor_regex: "\/v(.*)$" + version_extractor_regex: '\/v(.*)$' - id: environment - run: PRERELASE=${{ steps.semver.outputs.prerelease }} echo "var=$([ -z "${PRERELASE}" ] && echo "production" || echo "${PRERELASE}")" >> $GITHUB_OUTPUT + run: echo "var=${{ steps.semver.outputs.prerelease || "production" }}" >> $GITHUB_OUTPUT outputs: environment: ${{ steps.environment.outputs.var }} tag: v${{ steps.semver.outputs.fullversion }} diff --git a/.github/workflows/test_integration.yaml b/.github/workflows/test_integration.yaml index ce43b9a..5a67f5d 100644 --- a/.github/workflows/test_integration.yaml +++ b/.github/workflows/test_integration.yaml @@ -27,7 +27,9 @@ jobs: needs: [deploy_slug, build] uses: ./.github/workflows/deploy.yaml secrets: inherit - concurrency: ${{ needs.deploy_slug.outputs.environment }} + concurrency: + group: ${{ needs.deploy_slug.outputs.environment }} + cancel-in-progress: true with: environment: ${{ needs.deploy_slug.outputs.environment }} tag: ${{ needs.deploy_slug.outputs.tag }} @@ -35,7 +37,9 @@ jobs: test: runs-on: ubuntu-latest needs: [deploy_slug, deploy] - concurrency: ${{ needs.deploy_slug.outputs.environment }} + concurrency: + group: ${{ needs.deploy_slug.outputs.environment }} + cancel-in-progress: true steps: - run: echo "Do some integration tests on this tmp environment" @@ -43,7 +47,9 @@ jobs: needs: [deploy_slug, test] uses: ./.github/workflows/delete.yaml secrets: inherit - concurrency: ${{ needs.deploy_slug.outputs.environment }} + concurrency: + group: ${{ needs.deploy_slug.outputs.environment }} + cancel-in-progress: true if: ${{ always() }} with: environment: ${{ needs.deploy_slug.outputs.environment }} diff --git a/.github/workflows/test_unit.yaml b/.github/workflows/test_unit.yaml index 0972847..169ad8d 100644 --- a/.github/workflows/test_unit.yaml +++ b/.github/workflows/test_unit.yaml @@ -54,4 +54,5 @@ jobs: - run: dotnet restore ${{ matrix.project }} - run: dotnet build --no-restore ${{ matrix.project }} - run: docker-compose -f App.Lib.Tests/docker-compose.yaml up -d - - run: dotnet test --no-restore --no-build + - run: dotnet test --no-restore --no-build ${{ matrix.project }} +