Skip to content

Commit

Permalink
ci: fix github release issues with v2 pipelines (#334)
Browse files Browse the repository at this point in the history
  • Loading branch information
bardisg authored Jun 9, 2023
1 parent 18ff81c commit ffe7699
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 6 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/draft-new-release-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 16

# In order to make a commit, we need to initialize a user.
# You may choose to write something less generic here if you want, it doesn't matter functionality wise.
- name: Initialize mandatory git config
Expand All @@ -35,7 +35,8 @@ jobs:
source_branch_name=${GITHUB_REF##*/}
release_type=release
grep -q "hotfix/" <<< "${GITHUB_REF}" && release_type=hotfix-release
git fetch origin master-v2 --depth=1
git fetch origin master-v2
git fetch --tags origin
git merge origin/master-v2
current_version=$(jq -r .version package.json)
Expand Down Expand Up @@ -73,11 +74,11 @@ jobs:
git add README.md Sources/Classes/Common/Constants/RSVersion.swift sonar-project.properties
echo ${{ steps.create-release.outputs.new_version }}
echo "commit_summary=$SUMMARY" >> $GITHUB_OUTPUT
npx standard-version -a
npx standard-version -a --skip.tag
- name: Push new version in release branch & tag
run: |
git push --follow-tags
git push
- name: Create pull request into master
uses: repo-sync/pull-request@v2
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/publish-new-release-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,26 @@ jobs:
with:
node-version: 16

- name: Create Github Release
# In order to make a commit, we need to initialize a user.
# You may choose to write something less generic here if you want, it doesn't matter functionality wise.
- name: Initialize mandatory git config
run: |
git config user.name "GitHub actions"
git config user.email [email protected]
- name: Create Github Release & Tag
id: create_release
env:
HUSKY: 0
GITHUB_TOKEN: ${{ secrets.PAT }}
CONVENTIONAL_GITHUB_RELEASER_TOKEN: ${{ secrets.PAT }}
run: |
npx conventional-github-releaser -p angular
git for-each-ref refs/tags
./Scripts/find-tag.sh ${{ steps.extract-version.outputs.release_version }} && git tag --delete ${{ steps.extract-version.outputs.release_version }} && git push --delete origin ${{ steps.extract-version.outputs.release_version }}
git tag -a v${{ steps.extract-version.outputs.release_version }} -m "chore: release v${{ steps.extract-version.outputs.release_version }}"
git push origin refs/tags/v${{ steps.extract-version.outputs.release_version }}
git for-each-ref refs/tags
DEBUG=conventional-github-releaser npx conventional-github-releaser -p angular --config github-release.config.js
- name: Create pull request into develop
uses: repo-sync/pull-request@v2
Expand Down
7 changes: 7 additions & 0 deletions Scripts/find-tag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

if [ $(git tag -l "$1") ]; then
exit 0
else
exit 1
fi
5 changes: 5 additions & 0 deletions github-release.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
gitRawCommitsOpts: {
merges: null
}
}

0 comments on commit ffe7699

Please sign in to comment.