Skip to content

Commit f196c54

Browse files
authored
fix: sdk-5211 correct ios release workflows (#88)
1 parent 637b436 commit f196c54

3 files changed

Lines changed: 19 additions & 19 deletions

File tree

.github/workflows/deploy-cocoapods.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ permissions:
1010
jobs:
1111
build:
1212
name: Deploy to Cocoapods
13+
if: startsWith(github.event.release.tag_name, 'v')
1314
runs-on: macOS-latest
1415
steps:
1516
- name: Harden the runner (Audit all outbound calls)

.github/workflows/draft-new-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
run: |
4848
source_branch_name=${GITHUB_REF##*/}
4949
release_type=release
50-
git fetch origin master --depth=1
50+
git fetch origin master
5151
git merge origin/master
5252
current_version=$(jq -r .version package.json)
5353

.github/workflows/publish-new-release.yml

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ permissions:
1313
jobs:
1414
release:
1515
permissions:
16-
contents: read # to checkout code; App Token handles all writes
16+
contents: read # GitHub App token handles release writes
1717
name: Publish new release
1818
runs-on: ubuntu-latest
1919
if: startsWith(github.event.pull_request.head.ref, 'release/') && github.event.pull_request.merged == true # only merged pull requests must trigger this job
@@ -39,25 +39,24 @@ jobs:
3939
VERSION="${BRANCH_NAME#release/}"
4040
echo "release_version=$VERSION" >> $GITHUB_OUTPUT
4141
42-
- name: Checkout source branch
43-
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
44-
with:
45-
fetch-depth: 0
46-
token: ${{ steps.generate-token.outputs.token }}
47-
48-
- name: Set Node 16
49-
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
50-
with:
51-
node-version: 16
52-
53-
- name: Create Github Release
54-
id: create_release
42+
- name: Publish GitHub release
5543
env:
56-
HUSKY: 0
57-
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
58-
CONVENTIONAL_GITHUB_RELEASER_TOKEN: ${{ steps.generate-token.outputs.token }}
44+
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
45+
VERSION: ${{ steps.extract-version.outputs.release_version }}
5946
run: |
60-
npx conventional-github-releaser -p angular
47+
TAG="v${VERSION}"
48+
49+
if gh release view "$TAG" --repo "${{ github.repository }}" >/dev/null 2>&1; then
50+
echo "Release $TAG already exists; nothing to publish."
51+
exit 0
52+
fi
53+
54+
gh release create "$TAG" \
55+
--repo "${{ github.repository }}" \
56+
--verify-tag \
57+
--title "$TAG" \
58+
--generate-notes \
59+
--latest
6160
6261
- name: Delete release branch
6362
uses: koj-co/delete-merged-action@63a03c35810a8a7d4840d18793c0f68ff8b59450 # master

0 commit comments

Comments
 (0)