Skip to content

Commit cd627aa

Browse files
committed
test
1 parent 191b90a commit cd627aa

File tree

3 files changed

+133
-102
lines changed

3 files changed

+133
-102
lines changed

.github/project_workflows/create_release_pull_request.yml

+6-9
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ on:
77
description: "Next version (eg. 1.0.0)"
88
required: true
99
type: string
10-
push:
11-
branches:
12-
- feature/557-automate-release-pull-request-creation-process
1310

1411
concurrency:
1512
group: ${{ github.workflow }}-${{ github.ref }}
@@ -67,15 +64,15 @@ jobs:
6764
env:
6865
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6966
with:
70-
branch: chore/bump-version-to-1.1.0
67+
branch: chore/bump-version-to-${{ github.event.inputs.nextVersion }}
7168

7269
- name: Checkout code
7370
uses: actions/checkout@v4
7471
with:
75-
ref: chore/bump-version-to-1.1.0
72+
ref: chore/bump-version-to-${{ github.event.inputs.nextVersion }}
7673

7774
- name: Bump version
78-
run: sed -i "" "s/MARKETING_VERSION = .*/MARKETING_VERSION = 1.1.0;/g" Smashburger.xcodeproj/project.pbxproj
75+
run: sed -i "" "s/MARKETING_VERSION = .*/MARKETING_VERSION = ${{ github.event.inputs.nextVersion }};/g" Smashburger.xcodeproj/project.pbxproj
7976

8077
- name: Set up Git
8178
run: |
@@ -85,12 +82,12 @@ jobs:
8582
- name: Commit changes
8683
run: |
8784
git add .
88-
git commit -m "[Chore] Bump version to 1.1.0"
85+
git commit -m "[Chore] Bump version to ${{ github.event.inputs.nextVersion }}"
8986
git push origin HEAD
9087
9188
- name: Create pull request
9289
run: |
93-
echo -e "## What happened 👀\n\nBump version to 1.1.0" > body
94-
export body=$(cat body) ; gh pr create --draft -B develop -H chore/bump-version-to-1.1.0 -t '[Chore] Bump version to 1.1.0' -b "$body"
90+
echo -e "## What happened 👀\n\nBump version to ${{ github.event.inputs.nextVersion }}" > body
91+
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"
9592
env:
9693
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/create_release_pull_request.yml

-93
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
name: Create Release Pull Request
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
nextVersion:
7+
description: "Next version (eg. 1.0.0)x"
8+
required: true
9+
type: string
10+
push:
11+
branches:
12+
- feature/557-automate-release-pull-request-creation-process
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
create_release_pull_request:
20+
name: Create Release Pull Request
21+
runs-on: macOS-latest
22+
timeout-minutes: 30
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
27+
- name: Install SSH key
28+
uses: webfactory/[email protected]
29+
with:
30+
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
31+
32+
- name: Install Firebase-Tools
33+
run: |
34+
yarn global add firebase-tools
35+
echo "$(yarn global bin)" >> $GITHUB_PATH
36+
37+
- name: Read Google Service Account
38+
id: firebase_service_account
39+
uses: timheuer/[email protected]
40+
with:
41+
fileName: 'firebase_service_account.json'
42+
encodedString: ${{ secrets.FIREBASE_GOOGLE_APPLICATION_CREDENTIALS_BASE64 }}
43+
44+
- name: Bundle install
45+
run: bundle install
46+
47+
- name: Cache Pods
48+
uses: actions/cache@v3
49+
id: cocoapodCache
50+
with:
51+
path: Pods
52+
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
53+
restore-keys: |
54+
${{ runner.os }}-pods-
55+
56+
- name: Start Install Script for Template App
57+
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
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+
echo "RELEASE_VERSION=$(grep -oP 'MARKETING_VERSION\s*=\s*[^;]+' {PROJECT_NAME}.xcodeproj/project.pbxproj | head -n 1 | sed 's/^[^=]*=\s*//' | tr -d ' ')" >> $GITHUB_ENV
74+
echo "${{ steps.changelog.outputs.changelog }}" | sed 's/"/\\"/g' > escaped-changelog.txt
75+
76+
- name: Create Release branch
77+
uses: peterjgrainger/[email protected]
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
with:
81+
branch: release/${{ env.RELEASE_VERSION }}
82+
83+
- name: Create pull request
84+
run: gh pr create --draft -B main -H release/${{ env.RELEASE_VERSION }} -t 'Release - ${{ env.RELEASE_VERSION }}' -b "$(cat escaped-changelog.txt)"
85+
env:
86+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87+
88+
# create_bump_version_pull_request:
89+
# name: Create Bump Version Pull Request
90+
# runs-on: macos-latest
91+
# timeout-minutes: 30
92+
# permissions:
93+
# contents: write
94+
# pull-requests: write
95+
# steps:
96+
# - name: Create Bump Version branch
97+
# uses: peterjgrainger/[email protected]
98+
# env:
99+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
100+
# with:
101+
# branch: chore/bump-version-to-1.1.0
102+
103+
# - name: Checkout code
104+
# uses: actions/checkout@v4
105+
# with:
106+
# ref: chore/bump-version-to-1.1.0
107+
108+
# - name: Bump version
109+
# run: sed -i "" "s/MARKETING_VERSION = .*/MARKETING_VERSION = 1.1.0;/g" {PROJECT_NAME}.xcodeproj/project.pbxproj
110+
111+
# - name: Set up Git
112+
# run: |
113+
# git config --global user.name 'Github Actions'
114+
# git config --global user.email '[email protected]'
115+
116+
# - name: Commit changes
117+
# run: |
118+
# git add .
119+
# git commit -m "[Chore] Bump version to 1.1.0"
120+
# git push origin HEAD
121+
122+
# - name: Create pull request
123+
# run: |
124+
# echo -e "## What happened 👀\n\nBump version to 1.1.0" > body
125+
# export body=$(cat body) ; gh pr create --draft -B develop -H chore/bump-version-to-1.1.0 -t '[Chore] Bump version to 1.1.0' -b "$body"
126+
# env:
127+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)