Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
]
}
],
"max_pull_requests": 200
"pr_template": "- #{{TITLE}} (by @#{{ASSIGNEES}} in [##{{NUMBER}}](#{{URL}}))"
}
18 changes: 12 additions & 6 deletions .cicdtemplate/.github/workflows/create_release_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,27 @@ jobs:
name: Create Release Pull Request
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: write
pull-requests: write
issues: read
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # actions/checkout@v6.0.2
with:
fetch-depth: 1
fetch-depth: 0

- name: Get release version
id: extract_version
run: |
filename=$(find . -maxdepth 1 -name "*.xcodeproj" -exec basename {} .xcodeproj \; | head -n 1)
release_version=$(sed -n 's/.*MARKETING_VERSION *= *\([^;]*\);.*/\1/p' "$filename.xcodeproj/project.pbxproj" | head -n 1 | sed 's/^[^=]*=\s*//' | tr -d ' ')
echo $release_version
echo "RELEASE_VERSION=$release_version" >> "$GITHUB_ENV"
version=$(sed -n 's/.*MARKETING_VERSION *= *\([^;]*\);.*/\1/p' "$filename.xcodeproj/project.pbxproj" | head -n 1 | sed 's/^[^=]*=\s*//' | tr -d ' ')
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "Build version: $version"

- uses: nimblehq/github-actions-workflows/create_release_pull_request@d2f913f1faba9dd814eb0cab86147d2bab6e0e34 # nimblehq/github-actions-workflows/create_release_pull_request@v0.1.10
with:
release_version: ${{ env.RELEASE_VERSION }}
release_version: "${{ steps.extract_version.outputs.version }}"
changelog_configuration: ".github/workflows/configs/changelog-config.json"
assignee: bot-nimble
base_branch: main
assignee: ${{ github.actor }}
68 changes: 68 additions & 0 deletions .cicdtemplate/.github/workflows/tag_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Tag the new Release

on:
pull_request:
types: [closed]
branches:
- main

permissions:
actions: write
contents: write

jobs:
tag_and_release:
name: Tag and release
if: |
github.event.pull_request.merged == true
&& contains(github.event.pull_request.labels.*.name, 'type : release')
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Extract release version from head branch
id: extract_version
shell: bash
run: |
head_ref="${{ github.event.pull_request.head.ref }}"
if [[ ! "$head_ref" =~ ^release/([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
echo "Head ref '$head_ref' does not match release/X.Y.Z pattern"
exit 1
fi
version="${BASH_REMATCH[1]}"
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "Extracted version: $version"

- name: Checkout main at merge commit
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # actions/checkout@v6.0.2
with:
ref: ${{ github.event.pull_request.merge_commit_sha }}
fetch-depth: 0

- name: Ensure tag does not already exist
shell: bash
run: |
tag="${{ steps.extract_version.outputs.version }}"
if git rev-parse "refs/tags/$tag" >/dev/null 2>&1; then
echo "Tag $tag already exists — refusing to overwrite"
exit 1
fi

- name: Create and push tag
shell: bash
run: |
tag="${{ steps.extract_version.outputs.version }}"
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git tag -a "$tag" -m "Release $tag"
git push origin "$tag"

- name: Create GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
tag="${{ steps.extract_version.outputs.version }}"
gh release create "$tag" \
--target "${{ github.event.pull_request.merge_commit_sha }}" \
--title "$tag" \
--generate-notes
Loading