Skip to content

Commit 697edab

Browse files
committed
test
1 parent 61fd6bc commit 697edab

File tree

2 files changed

+162
-0
lines changed

2 files changed

+162
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"categories": [
3+
{
4+
"title": "## ✨ Features",
5+
"labels": [
6+
"type: feature"
7+
]
8+
},
9+
{
10+
"title": "## 🐛 Bug fixes",
11+
"labels": [
12+
"type: bug"
13+
]
14+
},
15+
{
16+
"title": "## 🧹 Chores",
17+
"labels": [
18+
"type: chore"
19+
]
20+
},
21+
{
22+
"title": "## Others",
23+
"exclude_labels": [
24+
"type: feature",
25+
"type: bug",
26+
"type: chore",
27+
"type: release"
28+
]
29+
}
30+
],
31+
"max_pull_requests": 200
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
name: Create Release Pull Request
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, edited, synchronize]
6+
workflow_dispatch:
7+
inputs:
8+
nextVersion:
9+
description: "Next version (eg. 1.0.0)"
10+
required: true
11+
type: string
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
create_release_pull_request:
19+
name: Create Release Pull Request
20+
runs-on: macOS-latest
21+
timeout-minutes: 30
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
26+
- name: Install SSH key
27+
uses: webfactory/[email protected]
28+
with:
29+
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
30+
31+
- name: Install Firebase-Tools
32+
run: |
33+
yarn global add firebase-tools
34+
echo "$(yarn global bin)" >> $GITHUB_PATH
35+
36+
- name: Read Google Service Account
37+
id: firebase_service_account
38+
uses: timheuer/[email protected]
39+
with:
40+
fileName: 'firebase_service_account.json'
41+
encodedString: ${{ secrets.FIREBASE_GOOGLE_APPLICATION_CREDENTIALS_BASE64 }}
42+
43+
- name: Bundle install
44+
run: bundle install
45+
46+
- name: Cache Pods
47+
uses: actions/cache@v3
48+
id: cocoapodCache
49+
with:
50+
path: Pods
51+
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
52+
restore-keys: |
53+
${{ runner.os }}-pods-
54+
55+
- name: Start Install Script for Template App
56+
run: swift run --package-path Scripts/Swift/iOSTemplateMaker iOSTemplateMaker make --bundle-id-production co.nimblehq.ios.templates --bundle-id-staging co.nimblehq.ios.templates.staging --project-name TemplateApp --interface UIKit
57+
58+
- name: Find HEAD commit
59+
id: head
60+
run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
61+
62+
- name: Build changelog on "main"
63+
id: changelog
64+
uses: mikepenz/release-changelog-builder-action@v4
65+
with:
66+
configuration: ".github/workflows/configs/changelog-config.json"
67+
# Listing PRs from the last tag to the HEAD commit
68+
toTag: ${{ steps.head.outputs.sha }}
69+
token: ${{ secrets.GITHUB_TOKEN }}
70+
71+
- name: Prepare variables
72+
run: |
73+
filename=$(find . -maxdepth 1 -name "*.xcodeproj" -exec basename {} .xcodeproj \; | head -n 1)
74+
release_version=$(sed -n 's/.*MARKETING_VERSION *= *\([^;]*\);.*/\1/p' "TemplateApp.xcodeproj/project.pbxproj" | head -n 1 | sed 's/^[^=]*=\s*//' | tr -d ' ')
75+
echo $release_version
76+
echo "RELEASE_VERSION=$release_version" >> "$GITHUB_ENV"
77+
echo "${{ steps.changelog.outputs.changelog }}" | sed 's/"/\\"/g' > escaped-changelog.txt
78+
79+
- name: Create Release branch
80+
uses: peterjgrainger/[email protected]
81+
env:
82+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83+
with:
84+
branch: release/${{ env.RELEASE_VERSION }}
85+
86+
- name: Create pull request
87+
run: gh pr create --draft -B main -H release/${{ env.RELEASE_VERSION }} -t 'Release - ${{ env.RELEASE_VERSION }}' -b "$(cat escaped-changelog.txt)"
88+
env:
89+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90+
91+
# create_bump_version_pull_request:
92+
# name: Create Bump Version Pull Request
93+
# runs-on: macos-latest
94+
# timeout-minutes: 30
95+
# permissions:
96+
# contents: write
97+
# pull-requests: write
98+
# steps:
99+
# - name: Create Bump Version branch
100+
# uses: peterjgrainger/[email protected]
101+
# env:
102+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
103+
# with:
104+
# branch: chore/bump-version-to-${{ github.event.inputs.nextVersion }}
105+
106+
# - name: Checkout code
107+
# uses: actions/checkout@v4
108+
# with:
109+
# ref: chore/bump-version-to-${{ github.event.inputs.nextVersion }}
110+
111+
# - name: Bump version
112+
# run: sed -i "" "s/MARKETING_VERSION = .*/MARKETING_VERSION = ${{ github.event.inputs.nextVersion }};/g" {PROJECT_NAME}.xcodeproj/project.pbxproj
113+
114+
# - name: Set up Git
115+
# run: |
116+
# git config --global user.name 'Github Actions'
117+
# git config --global user.email '[email protected]'
118+
119+
# - name: Commit changes
120+
# run: |
121+
# git add .
122+
# git commit -m "[Chore] Bump version to ${{ github.event.inputs.nextVersion }}"
123+
# git push origin HEAD
124+
125+
# - name: Create pull request
126+
# run: |
127+
# echo -e "## What happened 👀\n\nBump version to ${{ github.event.inputs.nextVersion }}" > body
128+
# export body=$(cat body) ; gh pr create --draft -B develop -H chore/bump-version-to-${{ github.event.inputs.nextVersion }} -t '[Chore] Bump version to ${{ github.event.inputs.nextVersion }}' -b "$body"
129+
# env:
130+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)