diff --git a/.github/workflows/release-build-and-stage-release-artifacts.yml b/.github/workflows/release-build-and-stage-release-artifacts.yml new file mode 100644 index 00000000..784c0b4f --- /dev/null +++ b/.github/workflows/release-build-and-stage-release-artifacts.yml @@ -0,0 +1,18 @@ +name: Build And Stage Release Artifacts +on: + push: + tags: + - '[0-9]+.[0-9]+.[0-9]+' + - '[0-9]+.[0-9]+.[0-9]+-*' +jobs: + build-artifacts: + uses: ./.github/workflows/release-build-artifacts.yml + secrets: inherit + stage-artifacts: + needs: build-artifacts + permissions: + contents: write + uses: ./.github/workflows/release-deploy-to-staging.yml + with: + version: ${{ github.ref_name }} + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release-build-artifacts.yml similarity index 58% rename from .github/workflows/release.yml rename to .github/workflows/release-build-artifacts.yml index d87e41c8..6a8d5a7b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release-build-artifacts.yml @@ -1,24 +1,21 @@ -name: Release +name: Build Artifacts on: - push: - tags: - - '[0-9]+.[0-9]+.[0-9]+' - - '[0-9]+.[0-9]+.[0-9]+-*' + workflow_call: env: DOTNET_NOLOGO: true defaults: run: shell: pwsh jobs: - release: + build-artifacts: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v6.0.1 + uses: actions/checkout@v7.0.1 with: fetch-depth: 0 - name: Setup .NET SDK - uses: actions/setup-dotnet@v5.1.0 + uses: actions/setup-dotnet@v6.1.0 with: global-json-file: global.json - name: Build @@ -30,14 +27,13 @@ jobs: tenant-id: ${{ secrets.AZURE_KEY_VAULT_TENANT_ID }} client-secret: ${{ secrets.AZURE_KEY_VAULT_CLIENT_SECRET }} certificate-name: ${{ secrets.AZURE_KEY_VAULT_CERTIFICATE_NAME }} - - name: Publish artifacts - uses: actions/upload-artifact@v6.0.0 + - name: Upload artifacts + uses: actions/upload-artifact@v7.0.2 with: name: nugets path: nugets/* retention-days: 1 - - name: Deploy - # Does not follow standard practice of targeting explicit versions because configuration is tightly coupled to Octopus Deploy configuration - uses: Particular/push-octopus-package-action@main + - name: Attach artifacts to release + uses: particular/deployment-workflows/.github/actions/create-draft-release-with-assets@1.0.0 with: - octopus-deploy-api-key: ${{ secrets.OCTOPUS_DEPLOY_API_KEY }} + asset-paths: "nugets/" diff --git a/.github/workflows/release-deploy-to-production.yml b/.github/workflows/release-deploy-to-production.yml new file mode 100644 index 00000000..542a0161 --- /dev/null +++ b/.github/workflows/release-deploy-to-production.yml @@ -0,0 +1,38 @@ +name: Deploy To Production +on: + workflow_dispatch: + inputs: + version: + required: true + type: string +env: + DOTNET_NOLOGO: true +jobs: + check-authorized-user: + uses: Particular/deployment-workflows/.github/workflows/verify-authorized-user.yml@1.0.0 + publish-release-notes: + needs: check-authorized-user + uses: Particular/deployment-workflows/.github/workflows/publish-release-notes.yml@1.0.0 + with: + version: ${{ inputs.version }} + secrets: inherit + virus-scan: + needs: publish-release-notes + permissions: + contents: write + uses: Particular/deployment-workflows/.github/workflows/virus-scan.yml@1.0.0 + with: + version: ${{ inputs.version }} + secrets: inherit + push-nuget-packages: + permissions: + id-token: write + contents: read + runs-on: ubuntu-latest + needs: publish-release-notes + steps: + - name: Push NuGet packages + uses: particular/deployment-workflows/.github/actions/push-nuget-packages@1.0.0 + with: + version: ${{ inputs.version }} + deploy-environment: production diff --git a/.github/workflows/release-deploy-to-staging.yml b/.github/workflows/release-deploy-to-staging.yml new file mode 100644 index 00000000..82e19383 --- /dev/null +++ b/.github/workflows/release-deploy-to-staging.yml @@ -0,0 +1,26 @@ +name: Deploy To Staging +on: + workflow_call: + inputs: + version: + required: true + type: string +env: + DOTNET_NOLOGO: true +jobs: + push-nuget-packages-staging: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Push NuGet packages + uses: Particular/deployment-workflows/.github/actions/push-nuget-packages@1.0.0 + with: + version: ${{ inputs.version }} + deploy-environment: staging + api-key: ${{ secrets.FEEDZIO_PUBLISH_API_KEY }} + generate-release-notes: + uses: Particular/deployment-workflows/.github/workflows/generate-release-notes.yml@1.0.0 + with: + version: ${{ inputs.version }} + secrets: inherit diff --git a/.github/workflows/virus-scan.yml b/.github/workflows/virus-scan.yml deleted file mode 100644 index da3c9bd4..00000000 --- a/.github/workflows/virus-scan.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Virus scan -on: - release: - types: [published] -jobs: - virus-scan: - runs-on: ubuntu-latest - steps: - - name: Scan release for viruses - uses: Particular/virus-scan-action@main - with: - owner: ${{ github.repository_owner }} - repo: ${{ github.event.repository.name }} - tag: ${{ github.event.release.name }} - github-access-token: ${{ secrets.GITHUB_TOKEN }} - slack-token: ${{ secrets.SLACK_TOKEN }} - slack-channel: ${{ vars.VIRUS_REPORTING_SLACK_CHANNEL }} diff --git a/.release/.templates/default/create/footer.sbn b/.release/.templates/default/create/footer.sbn new file mode 100644 index 00000000..19c9983f --- /dev/null +++ b/.release/.templates/default/create/footer.sbn @@ -0,0 +1,10 @@ +{{ if config.create.include_footer }} + +### Where to get it + + +You can download this release from [NuGet](https://www.nuget.org/profiles/ParticularSoftware/). + +{{ end }} + + \ No newline at end of file diff --git a/.release/.templates/default/issue-note.sbn b/.release/.templates/default/issue-note.sbn new file mode 100644 index 00000000..cc3a32ed --- /dev/null +++ b/.release/.templates/default/issue-note.sbn @@ -0,0 +1,6 @@ +{{ + if issue.is_pull_request +}}- [__#{{ issue.public_number }}__]({{ issue.html_url }}) {{ issue.title }} +{{ else +}}- [__#{{ issue.public_number }}__]({{ issue.html_url }}) {{ issue.title }} +{{ end -}} diff --git a/.release/GitReleaseManager.yaml b/.release/GitReleaseManager.yaml new file mode 100644 index 00000000..f6de466d --- /dev/null +++ b/.release/GitReleaseManager.yaml @@ -0,0 +1,10 @@ +templates-dir: .templates +create: + include-footer: true +issue-labels-include: + - "Bug" + - "Feature" + - "Improvement" + - "Dependency CVE" +issue-labels-exclude: + - "Refactoring"