1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15- name : New-Release
15+ name : release-new
1616
1717on :
1818 workflow_dispatch :
@@ -58,10 +58,11 @@ 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 : ./ mage -v defaultGitConfig
6566
6667 - name : Import GPG key
6768 uses : crazy-max/ghaction-import-gpg@v4
@@ -72,38 +73,23 @@ jobs:
7273 git_commit_gpgsign : true
7374
7475 - name : Install cosign private key
75- run : cd deployments/mage/ && mage -v writeCosignKeyToFile
76+ run : ./ mage -v writeCosignKeyToFile
7677 env :
7778 COSIGN_KEY : ${{secrets.COSIGN_KEY}}
7879
7980 - name : Version increment
8081 id : updated-version
8182 run : |
82- cd deployments/mage/ && mage -v upVersions ${{ github.event.inputs.releaseType }}
83+ ./ mage -v upVersions ${{ github.event.inputs.releaseType }}
8384 env :
8485 HORUSEC_REPOSITORY_ORG : ${{ github.repository_owner }}
8586 HORUSEC_REPOSITORY_NAME : ${{ github.event.repository.name }}
8687
8788 - name : Checkout release candidate branch
88- run : cd deployments/mage/ && mage -v checkoutReleaseBranch ${{ steps.updated-version.outputs.nextReleaseBranchName }}
89-
90- - name : Update versions on package.json
91- run : cd deployments/mage/ && mage -v updatePackageJson ${{ steps.updated-version.outputs.nextReleaseVersionStripped }}
89+ run : ./mage -v checkoutReleaseBranch ${{ steps.updated-version.outputs.nextReleaseBranchName }}
9290
93- - name : Update versions on rest of the project
94- run : cd deployments/mage/ && mage -v updateHorusecVersionInProject ${{ steps.updated-version.outputs.actualReleaseVersion }} ${{ steps.updated-version.outputs.nextReleaseVersion }} |
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
10591 - name : Create local tag
106- run : cd deployments/mage/ && mage -v createLocalTag ${{ steps.updated-version.outputs.nextReleaseVersion }}
92+ run : ./ mage -v createLocalTag ${{ steps.updated-version.outputs.nextReleaseVersion }}
10793
10894 - name : Run GoReleaser
10995 uses : goreleaser/goreleaser-action@v2
@@ -144,6 +130,23 @@ jobs:
144130 env :
145131 COSIGN_PASSWORD : ${{ secrets.COSIGN_PWD }}
146132
133+ - name : Update versions on package.json
134+ run : ./mage -v updatePackageJson ${{ steps.updated-version.outputs.nextReleaseVersionStripped }}
135+
136+ - name : Update versions on rest of the project
137+ run : |
138+ find . -type f -not -path "./.git/*" -not -path "./Makefile" -not -path "./manager/cypress/*" -not -name "*.sum" -not -name "*.mod"|
139+ xargs sed -i "s/${{ steps.updated-version.outputs.actualReleaseVersion }}/${{ steps.updated-version.outputs.nextReleaseVersion }}/g"
140+
141+ - name : Commit changes
142+ uses : EndBug/add-and-commit@v7.4.0
143+ with :
144+ push : false
145+ signoff : true
146+ author_name : Horusec
147+ author_email : horusec@zup.com.br
148+ committer_name : Horusec
149+ committer_email : horusec@zup.com.br
147150 # This step gets the sha of last commit made, witch is the updating versioning files commit, after that creates a
148151 # branch from the origin main and cherry pick this commit on it. This process need to occur only when the release
149152 # workflow is started from a branch that isn't the main branch, for example a release branch.
0 commit comments