diff --git a/.github/workflows/ci-cd-main.yml b/.github/workflows/ci-cd-main.yml index 6e0cee71b..ceeb08bd6 100644 --- a/.github/workflows/ci-cd-main.yml +++ b/.github/workflows/ci-cd-main.yml @@ -3,7 +3,7 @@ on: workflow_dispatch: push: - branches: [main] + branches: [ main ] concurrency: group: ${{ github.workflow }}-${{ github.ref_name }} @@ -30,7 +30,7 @@ jobs: build-and-test: name: Build and test backend uses: ./.github/workflows/workflow-build-and-test.yml - needs: [check-for-changes] + needs: [ check-for-changes ] if: ${{ github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasBackendChanges == 'true' || needs.check-for-changes.outputs.hasTestChanges == 'true' }} publish: @@ -52,7 +52,7 @@ jobs: deploy-infra: name: Deploy infra to test - needs: [get-current-version, check-for-changes, generate-git-short-sha] + needs: [ get-current-version, check-for-changes, generate-git-short-sha ] if: ${{ github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasInfraChanges == 'true' }} uses: ./.github/workflows/workflow-deploy-infra.yml secrets: @@ -98,12 +98,22 @@ jobs: version: ${{ needs.get-current-version.outputs.version }}-${{ needs.generate-git-short-sha.outputs.gitShortSha }} runMigration: ${{ github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasMigrationChanges == 'true' }} + generate-timestamp: + name: Generate timestamp + runs-on: ubuntu-latest + outputs: + timestamp: ${{ steps.get-timestamp.outputs.timestamp }} + steps: + - name: Get timestamp + id: get-timestamp + run: echo "timestamp=$(date +%s)" >> $GITHUB_OUTPUT + publish-sdk-to-nuget: uses: ./.github/workflows/workflow-publish-nuget.yml - needs: [ deploy-apps, get-current-version, generate-git-short-sha, check-for-changes ] + needs: [ deploy-apps, get-current-version, generate-git-short-sha, check-for-changes, generate-timestamp ] if: ${{ always() && !failure() && !cancelled() && ( needs.check-for-changes.outputs.hasSwaggerSchemaChanges == 'true' || needs.check-for-changes.outputs.hasWebApiClientChanges == 'true' ) }} with: - version: ${{ needs.get-current-version.outputs.version }}-rc.${{ needs.generate-git-short-sha.outputs.gitShortSha }} + version: ${{ needs.get-current-version.outputs.version }}-alpha.${{ needs.generate-timestamp.outputs.timestamp }}+${{ needs.generate-git-short-sha.outputs.gitShortSha }} path: 'src/Digdir.Library.Dialogporten.WebApiClient/Digdir.Library.Dialogporten.WebApiClient.csproj' source: 'https://api.nuget.org/v3/index.json' secrets: @@ -111,7 +121,7 @@ jobs: publish-schema-npm: name: Deploy schema npm package - needs: [check-for-changes, get-current-version, generate-git-short-sha, deploy-apps] + needs: [ check-for-changes, get-current-version, generate-git-short-sha, deploy-apps ] if: ${{ always() && !failure() && !cancelled() && (github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasSwaggerSchemaChanges == 'true' || needs.check-for-changes.outputs.hasGqlSchemaChanges == 'true') }} uses: ./.github/workflows/workflow-publish-schema.yml with: @@ -123,7 +133,7 @@ jobs: name: "Run K6 functional end-to-end tests" # we want the end-to-end tests to be dependent on deployment of infrastructure and apps, but if infrastructure is skipped, we still want to run the tests if: ${{ always() && !failure() && !cancelled() && (github.event_name == 'workflow_dispatch' || needs.check-for-changes.outputs.hasBackendChanges == 'true' || needs.check-for-changes.outputs.hasTestChanges == 'true') }} - needs: [deploy-apps, check-for-changes] + needs: [ deploy-apps, check-for-changes ] uses: ./.github/workflows/workflow-run-k6-tests.yml secrets: TOKEN_GENERATOR_USERNAME: ${{ secrets.TOKEN_GENERATOR_USERNAME }} diff --git a/.github/workflows/ci-cd-staging.yml b/.github/workflows/ci-cd-staging.yml index 8f89b442f..9b8e0ee10 100644 --- a/.github/workflows/ci-cd-staging.yml +++ b/.github/workflows/ci-cd-staging.yml @@ -10,6 +10,10 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref_name }} jobs: + generate-git-short-sha: + name: Generate git short sha + uses: ./.github/workflows/workflow-generate-git-short-sha.yml + get-versions-from-github: name: Get Latest Deployed Version Info from GitHub uses: ./.github/workflows/workflow-get-latest-deployed-version-info-from-github.yml @@ -81,10 +85,10 @@ jobs: publish-sdk-to-nuget: uses: ./.github/workflows/workflow-publish-nuget.yml - needs: [ deploy-apps, check-for-changes ] + needs: [ deploy-apps, check-for-changes, generate-git-short-sha ] if: ${{ always() && !failure() && !cancelled() && ( needs.check-for-changes.outputs.hasSwaggerSchemaChanges == 'true' || needs.check-for-changes.outputs.hasWebApiClientChanges == 'true' )}} with: - version: ${{ github.event.client_payload.version }}-rc + version: ${{ github.event.client_payload.version }}-rc+${{ needs.generate-git-short-sha.outputs.gitShortSha }} path: 'src/Digdir.Library.Dialogporten.WebApiClient/Digdir.Library.Dialogporten.WebApiClient.csproj' source: 'https://api.nuget.org/v3/index.json' secrets: