From fe7890d80c0c928479b73791315d096c79db901e Mon Sep 17 00:00:00 2001 From: James Armes Date: Wed, 9 Oct 2024 14:26:17 -0400 Subject: [PATCH] fix: Remove dry run --- .github/workflows/main.yml | 41 +++++++++++++++++++++++++-- .github/workflows/release-test.yaml | 1 - aptible/managed_endpoint/CHANGELOG.md | 8 ++---- 3 files changed, 42 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2b8b139..9be1af7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,6 +7,7 @@ on: jobs: find-modules: + name: Find updated modules runs-on: ubuntu-latest steps: - name: Checkout source code @@ -54,6 +55,7 @@ jobs: modules: ${{ steps.modified.outputs.modules }} lint: + name: Lint updated modules runs-on: ubuntu-latest needs: find-modules steps: @@ -93,7 +95,7 @@ jobs: exit $exit_code trivy: - name: trivy + name: Run security scan runs-on: ubuntu-latest steps: - name: Checkout source code @@ -104,8 +106,43 @@ jobs: scan-type: config format: sarif output: "trivy-results.sarif" - - name: Upload SARIF result uses: github/codeql-action/upload-sarif@v3 with: sarif_file: "trivy-results.sarif" + + release: + name: Release updated modules + runs-on: ubuntu-latest + needs: find-modules + strategy: + matrix: + module: ${{fromJson(needs.find-modules.outputs.modules)}} + steps: + - name: Checkout source code + uses: actions/checkout@v4 + - run: cp ${{ matrix.module }}/.cz.yaml .cz.yaml + - name: Bump version and create changelog + id: bump + uses: commitizen-tools/commitizen-action@master + with: + push: true + github_token: ${{ secrets.GITHUB_TOKEN }} + changelog_increment_filename: release.md + - name: Get the module name + id: module_name + run: | + MODULE_PATH="${{ matrix.module }}" + MODULE_NAME="${MODULE_PATH//\//_}" + echo "name=${MODULE_NAME}" >> $GITHUB_OUTPUT + - run: echo '${{ steps.module_name.outputs.name }}' + - name: Bundle the module + run: tar czf "${{ steps.module_name.outputs.name }}-${{ steps.bump.outputs.version }}.tar.gz" ${{ matrix.module }} + - name: Create release + uses: softprops/action-gh-release@v2 + with: + body_path: release.md + tag_name: ${{ steps.module_name.outputs.name }}-${{ steps.bump.outputs.version }} + files: | + release.md + ${{ steps.module_name.outputs.name }}-${{ steps.bump.outputs.version }}.tar.gz diff --git a/.github/workflows/release-test.yaml b/.github/workflows/release-test.yaml index f6dc468..6ba7595 100644 --- a/.github/workflows/release-test.yaml +++ b/.github/workflows/release-test.yaml @@ -69,7 +69,6 @@ jobs: with: push: true github_token: ${{ secrets.GITHUB_TOKEN }} - dry_run: true changelog_increment_filename: release.md - name: Get the module name id: module_name diff --git a/aptible/managed_endpoint/CHANGELOG.md b/aptible/managed_endpoint/CHANGELOG.md index 28235c0..ed19f78 100644 --- a/aptible/managed_endpoint/CHANGELOG.md +++ b/aptible/managed_endpoint/CHANGELOG.md @@ -2,12 +2,10 @@ All notable changes to this project will be documented in this file. -The format is based on [Keep a Changelog][changelog], and this project adheres -to [Semantic Versioning][semver]. +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to +[Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] Initial release of the Aptible Managed Endpoint module. - -[changelog]: https://keepachangelog.com/en/1.1.0/ -[semver]: https://semver.org/spec/v2.0.0.html