Skip to content

Commit d6027c2

Browse files
Merge branch 'master' into feat/move_to_to_of_body
2 parents 2046623 + 9043225 commit d6027c2

File tree

8 files changed

+60
-56
lines changed

8 files changed

+60
-56
lines changed

.github/workflows/build-push.yml

Lines changed: 34 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,40 @@ jobs:
2525
java-version: ${{ env.JAVA_VERSION }}
2626
distribution: ${{ env.JAVA_DISTRIBUTION }}
2727

28+
- name: Install branch-github-actions
29+
uses: actions/checkout@v4
30+
with:
31+
repository: BranchMetrics/branch-github-actions
32+
ref: master
33+
path: .branch-github-actions
34+
token: ${{ secrets.BRANCHLET_ACCESS_TOKEN_PUBLIC }}
35+
36+
- name: Add INPUT_SHA env var
37+
run: |
38+
export INPUT_SHA=$(git rev-parse ${{ github.ref }})
39+
echo "INPUT_SHA=`echo $INPUT_SHA`" >> $GITHUB_ENV
40+
41+
- name: Get next release version
42+
uses: actions/github-script@v7
43+
id: next-version
44+
with:
45+
result-encoding: string
46+
script: |
47+
const getNextVersion = require('./.branch-github-actions/custom-scripts/next-version');
48+
const nextVersion = await getNextVersion({
49+
core,
50+
github,
51+
context,
52+
sha: process.env.INPUT_SHA,
53+
});
54+
return nextVersion;
55+
env:
56+
INPUT_SHA: ${{ env.INPUT_SHA }}
57+
58+
- name: Write version to files
59+
run: |
60+
./deployment/write-versions.sh ${{ steps.next-version.outputs.result }}
61+
2862
- name: Install dependencies
2963
run: npm run ci
3064

@@ -67,44 +101,6 @@ jobs:
67101
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
68102
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
69103

70-
- name: Install branch-github-actions
71-
if: ${{ github.ref == 'refs/heads/master' }}
72-
uses: actions/checkout@v4
73-
with:
74-
repository: BranchMetrics/branch-github-actions
75-
ref: master
76-
path: .branch-github-actions
77-
token: ${{ secrets.BRANCHLET_ACCESS_TOKEN_PUBLIC }}
78-
79-
- name: Add INPUT_SHA env var
80-
if: ${{ github.ref == 'refs/heads/master' }}
81-
run: |
82-
export INPUT_SHA=$(git rev-parse ${{ github.ref }})
83-
echo "INPUT_SHA=`echo $INPUT_SHA`" >> $GITHUB_ENV
84-
85-
- name: Get next release version
86-
if: ${{ github.ref == 'refs/heads/master' }}
87-
uses: actions/github-script@v7
88-
id: next-version
89-
with:
90-
result-encoding: string
91-
script: |
92-
const getNextVersion = require('./.branch-github-actions/custom-scripts/next-version');
93-
const nextVersion = await getNextVersion({
94-
core,
95-
github,
96-
context,
97-
sha: process.env.INPUT_SHA,
98-
});
99-
return nextVersion;
100-
env:
101-
INPUT_SHA: ${{ env.INPUT_SHA }}
102-
103-
- name: Write version to files
104-
if: ${{ github.ref == 'refs/heads/master' }}
105-
run: |
106-
./deployment/write-versions.sh ${{ steps.next-version.outputs.result }}
107-
108104
- name: Deploy updated builds to staging
109105
if: ${{ github.ref == 'refs/heads/master' }}
110106
id: build

.github/workflows/deploy-release.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@ name: Publish Next Release (Manual)
22

33
on:
44
workflow_dispatch:
5-
inputs:
6-
ref:
7-
description: Reference git commit to release (e.g. "master", "12341fa")
8-
required: true
9-
default: master
105

116
env:
127
NODE_VERSION: 18
@@ -16,8 +11,6 @@ jobs:
1611
runs-on: ubuntu-latest
1712
steps:
1813
- uses: actions/checkout@v4
19-
with:
20-
ref: ${{ github.event.inputs.ref }}
2114

2215
- name: AWS, credentials setup
2316
uses: aws-actions/configure-aws-credentials@v4
@@ -28,7 +21,7 @@ jobs:
2821

2922
- name: Add INPUT_SHA env var
3023
run: |
31-
export INPUT_SHA=$(git rev-parse ${{ github.event.inputs.ref }})
24+
export INPUT_SHA=$(git rev-parse ${{ github.ref }})
3225
echo "INPUT_SHA=`echo $INPUT_SHA`" >> $GITHUB_ENV
3326
3427
- name: Install branch-github-actions
@@ -60,17 +53,26 @@ jobs:
6053
uses: actions/setup-node@v4
6154
with:
6255
node-version: ${{ env.NODE_VERSION }}
56+
registry-url: 'https://registry.npmjs.org'
6357

58+
# Do this before npm configure because it writes the package.json version
6459
- name: Write version to files
6560
run: |
6661
./deployment/write-versions.sh ${{ steps.next-version.outputs.result }}
6762
6863
- name: Configure NPM
6964
run: npm ci
7065

71-
- name: Release to npm, s3, prod
66+
- run: make release
67+
68+
- name: Publish to s3
7269
run: |
73-
./deployment/release.sh ${{ steps.next-version.outputs.result }}
70+
./deployment/release-s3.sh ${{ steps.next-version.outputs.result }}
71+
72+
- name: Publish to npm
73+
env:
74+
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISHER_TOKEN }}
75+
run: npm publish
7476

7577
- name: Create Github Release
7678
uses: actions/github-script@v7

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ All notable changes to the Branch Web SDK will be documented here.
33
The Branch Web SDK adheres to [Semantic Versioning](http://semver.org/).
44

55
## [VERSION] - unreleased
6+
## [2.85.4] - 2024-11-11
7+
- updates release process
8+
## [2.85.2] - 2024-11-11
9+
- Updates release process
610
## [2.85.1] - 2024-11-04
711
- Updates qr image download to avoid errors
812
## [2.85.0] - 2024-04-10

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ all: dist/build.min.js dist/build.js test/branch-deps.js test/integration-test.h
3737
clean:
3838
rm -f dist/** docs/web/3_branch_web.md test/branch-deps.js dist/build.min.js.gz test/integration-test.html
3939
release: clean all dist/build.min.js.gz
40-
@echo "released"
4140

4241
test/branch-deps.js: $(SOURCES)
4342
npx closure-make-deps \
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ make release
1212

1313
./deployment/build-example-html.sh "key_live_hcnegAumkH7Kv18M8AOHhfgiohpXq5tB" "https://api2.branch.io" "https://cdn.branch.io/branch-latest.min.js"
1414
aws s3 cp example.html s3://branch-builds/example.html
15+
aws s3 cp example.html s3://branch-cdn/example.html
1516

16-
aws s3 cp --content-type="text/javascript" --content-encoding="gzip" dist/build.min.js.gz s3://branch-cdn/branch-$VERSION.min.js --acl public-read
17-
aws s3 cp --content-type="text/javascript" --content-encoding="gzip" dist/build.min.js.gz s3://branch-cdn/branch-latest.min.js --acl public-read
17+
aws s3 cp --content-type="text/javascript" --content-encoding="gzip" dist/build.js s3://branch-cdn/branch-latest.js --cache-control "max-age=300"
18+
aws s3 cp --content-type="text/javascript" --content-encoding="gzip" dist/build.min.js.gz s3://branch-cdn/branch-$VERSION.min.js --cache-control "max-age=300"
19+
aws s3 cp --content-type="text/javascript" --content-encoding="gzip" dist/build.min.js.gz s3://branch-cdn/branch-latest.min.js --cache-control "max-age=300"
1820

1921
echo -en "Invalidating cloudfront distribution...\n"
2022
aws configure set preview.cloudfront true
2123
aws cloudfront create-invalidation --distribution-id E10P37NG0GMER --paths /branch-latest.min.js
2224

23-
npm publish
24-
2525
echo "Post-release sanity checks."
2626
read -p "Can you visit https://cdn.branch.io/branch-$VERSION.min.js ?" -n 1 -r
2727
echo

examples/example.template.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,8 @@ <h4>QR Code</h4>
250250
"background_color": "#FFFFFF",
251251
"margin": 5,
252252
"width": 1000,
253-
"image_format": "png"
253+
"image_format": "png",
254+
"center_logo_url": "https://branch-assets.s3.us-west-1.amazonaws.com/branch-badge-dark.svg",
254255
};
255256
var qrCodeParams = {
256257
tags: [ 'tag1', 'tag2' ],

src/0_config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ var DEFAULT_API_ENDPOINT = 'https://api2.branch.io';
88
config.app_service_endpoint = 'https://app.link';
99
config.link_service_endpoint = 'https://bnc.lt';
1010
config.api_endpoint = DEFAULT_API_ENDPOINT;
11-
config.version = '2.85.1'; // will get overwritten by gha on actual deploy
11+
// will get overwritten by gha on actual deploy
12+
config.version = '2.85.2';

test/web-config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ goog.provide('config');
66
config.app_service_endpoint = 'https://app.link';
77
config.link_service_endpoint = 'https://bnc.lt';
88
config.api_endpoint = 'https://api.branch.io';
9-
config.version = '2.85.1'; // will get overwritten by gha on actual deploy
9+
// will get overwritten by gha on actual deploy
10+
config.version = '2.85.2';

0 commit comments

Comments
 (0)