@@ -58,10 +58,12 @@ jobs:
5858 cosign-release : ' v1.2.0'
5959
6060 - name : Install Mage
61- run : go install github.com/magefile/mage@07afc7d24f4d6d6442305d49552f04fbda5ccb3e
61+ run : |
62+ cd deployments/mage/ && go run mage.go -compile ../../mage
6263
6364 - name : Git config
64- run : cd deployments/mage/ && mage -v defaultGitConfig
65+ run : |
66+ ./mage -v defaultGitConfig
6567
6668 - name : Import GPG key
6769 uses : crazy-max/ghaction-import-gpg@v4
@@ -72,59 +74,58 @@ jobs:
7274 git_commit_gpgsign : true
7375
7476 - name : Install cosign private key
75- run : cd deployments/mage/ && mage -v writeCosignKeyToFile
77+ run : |
78+ ./mage -v writeCosignKeyToFile
7679 env :
7780 COSIGN_KEY : ${{secrets.COSIGN_KEY}}
7881
7982 - name : Version increment
8083 id : updated-version
8184 run : |
82- cd deployments/mage/ && mage -v upVersions ${{ github.event.inputs.releaseType }}
85+ ./ mage -v upVersions ${{ github.event.inputs.releaseType }}
8386 env :
8487 HORUSEC_REPOSITORY_ORG : ${{ github.repository_owner }}
8588 HORUSEC_REPOSITORY_NAME : ${{ github.event.repository.name }}
8689
8790 - name : Checkout release candidate branch
88- run : cd deployments/mage/ && mage -v checkoutRcBranch ${{ steps.updated-version.outputs.rcVersion }}
89-
90- # - name: Update versions on package.json
91- # run: cd deployments/mage/ && mage -v updatePackageJson ${{ steps.updated-version.outputs.strippedVersion }}
92-
93- # - name: Update versions on rest of the project
94- # run: cd deployments/mage/ && mage -v updateHorusecVersionInProject ${{ steps.updated-version.outputs.actualVersion }} ${{ steps.updated-version.outputs.rcVersion }} |
95-
96- # - name: Commit changes
97- # uses: EndBug/add-and-commit@v7.4.0
98- # with:
99- # push: false
100- # signoff: true
101- # author_name: Horusec
102- # author_email: horusec@zup.com.br
103- # committer_name: Horusec
104- # committer_email: horusec@zup.com.br
91+ run : |
92+ ./mage -v checkoutReleaseBranch ${{ steps.updated-version.outputs.nextReleaseBranchName }}
93+
10594 - name : Create local tag
106- run : cd deployments/mage/ && mage -v createLocalTag ${{ steps.updated-version.outputs.rcVersion }}
95+ run : |
96+ ./mage -v createLocalTag ${{ steps.updated-version.outputs.nextRcVersion }}
10797
10898 - name : Run GoReleaser
10999 uses : goreleaser/goreleaser-action@v2
110100 with :
111101 distribution : goreleaser
112102 version : latest
113- args : release --rm-dist
103+ args : release --rm-dist --skip-publish
114104 env :
115105 COSIGN_KEY : ${{ secrets.COSIGN_KEY }}
116106 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
117107 COSIGN_PWD : ${{ secrets.COSIGN_PWD }}
118- GORELEASER_CURRENT_TAG : ${{ steps.updated-version.outputs.rcVersion }}
108+ GORELEASER_CURRENT_TAG : ${{ steps.updated-version.outputs.nextRcVersion }}
109+
110+ - name : Push go projects to dockerhub
111+ run : |
112+ ./mage -v dockerPushPlatformGoProjects ${{ steps.updated-version.outputs.nextRcVersion }}
113+
114+ - name : Sign go projects in dockerhub
115+ env :
116+ COSIGN_KEY : ${{secrets.COSIGN_KEY}}
117+ COSIGN_PASSWORD : ${{ secrets.COSIGN_PWD }}
118+ run : |
119+ ./mage -v dockerSignPlatformGoProjects ${{ steps.updated-version.outputs.nextRcVersion }}
119120
120121 - name : " Docker meta"
121122 uses : docker/metadata-action@v3
122123 id : meta
123124 env :
124- RELEASE_VERSION : ${{ steps.updated-version.outputs.version }}
125+ RELEASE_VERSION : ${{ steps.updated-version.outputs.nextRcVersion }}
125126 with :
126127 images : |
127- horuszup /horusec-manager
128+ osodracnai /horusec-manager
128129 tags : |
129130 type=semver,prefix=v,pattern={{version}},value=${{ env.RELEASE_VERSION }}
130131 type=semver,prefix=v,pattern={{major}}.{{minor}},value=${{ env.RELEASE_VERSION }}
@@ -138,34 +139,13 @@ jobs:
138139 file : ./manager/deployments/dockerfiles/Dockerfile
139140 tags : ${{ steps.meta.outputs.tags }}
140141 labels : ${{ steps.meta.outputs.labels }}
142+
141143 - name : Sign image
142144 run : |
143- cosign sign -key $COSIGN_KEY_LOCATION horuszup /horusec-manager:latest
145+ cosign sign -key $COSIGN_KEY_LOCATION osodracnai /horusec-manager:${{ steps.updated-version.outputs.nextRcVersion }}
144146 env :
145147 COSIGN_PASSWORD : ${{ secrets.COSIGN_PWD }}
146148
147- # # This step gets the sha of last commit made, witch is the updating versioning files commit, after that creates a
148- # # branch from the origin main and cherry pick this commit on it. This process need to occur only when the release
149- # # workflow is started from a branch that isn't the main branch, for example a release branch.
150- # # When the workflow it's triggered to run on main, the commit it's going to be made directly to the main branch.
151- # - name: Cherry pick
152- # if: github.ref != 'refs/heads/main'
153- # id: cherry-pick
154- # run: |
155- # mage CherryPick
156- # - name: Push updates
157- # run: cd deployments/mage/ && mage -v gitPushAll
158- #
159- #
160- # # This step utilizes an action to create a pull request with the branch that was cherry picked on the last step
161- # # into the main branch. As the last commit, this also needs to run only when the release workflow is started from a
162- # # branch that isn't the main branch. Others workflows should be skipped cause of the skip ci in the pull request title.
163- # - name: Create Pull Request
164- # if: github.ref != 'refs/heads/main'
165- # uses: repo-sync/pull-request@v2
166- # with:
167- # source_branch: "${{ steps.cherry-pick.outputs.branchName }}"
168- # destination_branch: "main"
169- # pr_title: "versioning:release - [skip ci] automatic pull request updating versioning files"
170- # pr_body: "This is a automatic pull request that contains changes to files that need to be updated with the new release version. Where the commit ${{ steps.cherry-pick.outputs.commitSha }} was cherry picked from the release branch, which already contains all the necessary changes."
171- # github_token: ${{ secrets.HORUSEC_PUSH_TOKEN }}
149+ - name : Push updates
150+ run : |
151+ ./mage -v gitPushAll
0 commit comments