Skip to content

Commit 81271b4

Browse files
committed
[throwaway] use to invalidate s3
1 parent 3a65201 commit 81271b4

File tree

2 files changed

+108
-108
lines changed

2 files changed

+108
-108
lines changed

.github/workflows/deploy-release.yml

Lines changed: 78 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -12,83 +12,83 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v4
1414

15-
- name: AWS, credentials setup
16-
uses: aws-actions/configure-aws-credentials@v4
17-
with:
18-
aws-region: us-west-1
19-
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
20-
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
21-
22-
- name: Add INPUT_SHA env var
23-
run: |
24-
export INPUT_SHA=$(git rev-parse ${{ github.ref }})
25-
echo "INPUT_SHA=`echo $INPUT_SHA`" >> $GITHUB_ENV
26-
27-
- name: Install branch-github-actions
28-
uses: actions/checkout@v4
29-
with:
30-
repository: BranchMetrics/branch-github-actions
31-
ref: master
32-
path: .branch-github-actions
33-
token: ${{ secrets.BRANCHLET_ACCESS_TOKEN_PUBLIC }}
34-
35-
- name: Get next release version
36-
uses: actions/github-script@v7
37-
id: next-version
38-
with:
39-
result-encoding: string
40-
script: |
41-
const getNextVersion = require('./.branch-github-actions/custom-scripts/next-version');
42-
const nextVersion = await getNextVersion({
43-
core,
44-
github,
45-
context,
46-
sha: process.env.INPUT_SHA,
47-
});
48-
return nextVersion;
49-
env:
50-
INPUT_SHA: ${{ env.INPUT_SHA }}
51-
52-
- name: Install Node ${{ env.NODE_VERSION }}
53-
uses: actions/setup-node@v4
54-
with:
55-
node-version: ${{ env.NODE_VERSION }}
56-
registry-url: 'https://registry.npmjs.org'
57-
58-
# Do this before npm configure because it writes the package.json version
59-
- name: Write version to files
60-
run: |
61-
./deployment/write-versions.sh ${{ steps.next-version.outputs.result }}
62-
63-
- name: Configure NPM
64-
run: npm ci
65-
66-
- run: make release
67-
68-
- name: Publish to s3
15+
# - name: AWS, credentials setup
16+
# uses: aws-actions/configure-aws-credentials@v4
17+
# with:
18+
# aws-region: us-west-1
19+
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
20+
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
21+
#
22+
# - name: Add INPUT_SHA env var
23+
# run: |
24+
# export INPUT_SHA=$(git rev-parse ${{ github.ref }})
25+
# echo "INPUT_SHA=`echo $INPUT_SHA`" >> $GITHUB_ENV
26+
#
27+
# - name: Install branch-github-actions
28+
# uses: actions/checkout@v4
29+
# with:
30+
# repository: BranchMetrics/branch-github-actions
31+
# ref: master
32+
# path: .branch-github-actions
33+
# token: ${{ secrets.BRANCHLET_ACCESS_TOKEN_PUBLIC }}
34+
#
35+
# - name: Get next release version
36+
# uses: actions/github-script@v7
37+
# id: next-version
38+
# with:
39+
# result-encoding: string
40+
# script: |
41+
# const getNextVersion = require('./.branch-github-actions/custom-scripts/next-version');
42+
# const nextVersion = await getNextVersion({
43+
# core,
44+
# github,
45+
# context,
46+
# sha: process.env.INPUT_SHA,
47+
# });
48+
# return nextVersion;
49+
# env:
50+
# INPUT_SHA: ${{ env.INPUT_SHA }}
51+
#
52+
# - name: Install Node ${{ env.NODE_VERSION }}
53+
# uses: actions/setup-node@v4
54+
# with:
55+
# node-version: ${{ env.NODE_VERSION }}
56+
# registry-url: 'https://registry.npmjs.org'
57+
#
58+
# # Do this before npm configure because it writes the package.json version
59+
# - name: Write version to files
60+
# run: |
61+
# ./deployment/write-versions.sh ${{ steps.next-version.outputs.result }}
62+
#
63+
# - name: Configure NPM
64+
# run: npm ci
65+
#
66+
# - run: make release
67+
#
68+
- name: invalidate to s3
6969
run: |
7070
./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
76-
77-
- name: Create Github Release
78-
uses: actions/github-script@v7
79-
env:
80-
GE_NEXT_VERSION: ${{ steps.next-version.outputs.result }}
81-
INPUT_SHA: ${{ env.INPUT_SHA }}
82-
with:
83-
result-encoding: string
84-
script: |
85-
const createRelease = require('./.branch-github-actions/custom-scripts/create-release');
86-
const sha = process.env.INPUT_SHA;
87-
const version = process.env.GE_NEXT_VERSION;
88-
await createRelease({
89-
core,
90-
context,
91-
github,
92-
sha,
93-
version,
94-
});
71+
#
72+
# - name: Publish to npm
73+
# env:
74+
# NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISHER_TOKEN }}
75+
# run: npm publish
76+
#
77+
# - name: Create Github Release
78+
# uses: actions/github-script@v7
79+
# env:
80+
# GE_NEXT_VERSION: ${{ steps.next-version.outputs.result }}
81+
# INPUT_SHA: ${{ env.INPUT_SHA }}
82+
# with:
83+
# result-encoding: string
84+
# script: |
85+
# const createRelease = require('./.branch-github-actions/custom-scripts/create-release');
86+
# const sha = process.env.INPUT_SHA;
87+
# const version = process.env.GE_NEXT_VERSION;
88+
# await createRelease({
89+
# core,
90+
# context,
91+
# github,
92+
# sha,
93+
# version,
94+
# });

deployment/release-s3.sh

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
#!/bin/bash
2-
3-
[ $# -eq 0 ] && { echo "Usage: $0 1.0.0"; exit 1; }
4-
5-
VERSION_NO_V=$1
6-
VERSION="v"$VERSION_NO_V
7-
DATE=$(date "+%Y-%m-%d")
8-
9-
echo "Releasing Branch Web SDK"
10-
11-
make release
12-
13-
# Engagement Pro Production Testing App - ID: 1364963849844839205
14-
./deployment/build-example-html.sh "key_live_gAbR03mCEte9DLh6L9GFApebvyg4mMDw" "https://api2.branch.io" "https://cdn.branch.io/branch-latest.min.js"
15-
aws s3 cp example.html s3://branch-builds/example.html
16-
aws s3 cp example.html s3://branch-cdn/example.html
17-
18-
aws s3 cp --content-type="text/javascript" --content-encoding="gzip" dist/build.js s3://branch-cdn/branch-latest.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-$VERSION.min.js --cache-control "max-age=300"
20-
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"
21-
1+
##!/bin/bash
2+
#
3+
#[ $# -eq 0 ] && { echo "Usage: $0 1.0.0"; exit 1; }
4+
#
5+
#VERSION_NO_V=$1
6+
#VERSION="v"$VERSION_NO_V
7+
#DATE=$(date "+%Y-%m-%d")
8+
#
9+
#echo "Releasing Branch Web SDK"
10+
#
11+
#make release
12+
#
13+
## Engagement Pro Production Testing App - ID: 1364963849844839205
14+
#./deployment/build-example-html.sh "key_live_gAbR03mCEte9DLh6L9GFApebvyg4mMDw" "https://api2.branch.io" "https://cdn.branch.io/branch-latest.min.js"
15+
#aws s3 cp example.html s3://branch-builds/example.html
16+
#aws s3 cp example.html s3://branch-cdn/example.html
17+
#
18+
#aws s3 cp --content-type="text/javascript" --content-encoding="gzip" dist/build.js s3://branch-cdn/branch-latest.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-$VERSION.min.js --cache-control "max-age=300"
20+
#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"
21+
#
2222
echo -en "Invalidating cloudfront distribution...\n"
2323
aws configure set preview.cloudfront true
24-
aws cloudfront create-invalidation --distribution-id E10P37NG0GMER --paths /branch-latest.min.js /example.html
25-
26-
echo "Post-release sanity checks."
27-
read -p "Can you visit https://cdn.branch.io/branch-$VERSION.min.js ?" -n 1 -r
28-
echo
29-
read -p "Is https://cdn.branch.io/example.html using the right version number $VERSION?" -n 1 -r
30-
echo
31-
read -p "Is https://www.npmjs.com/package/branch-sdk using the right version number $VERSION?" -n 1 -r
32-
echo
24+
aws cloudfront create-invalidation --distribution-id E10P37NG0GMER --paths /example.html
25+
26+
#echo "Post-release sanity checks."
27+
#read -p "Can you visit https://cdn.branch.io/branch-$VERSION.min.js ?" -n 1 -r
28+
#echo
29+
#read -p "Is https://cdn.branch.io/example.html using the right version number $VERSION?" -n 1 -r
30+
#echo
31+
#read -p "Is https://www.npmjs.com/package/branch-sdk using the right version number $VERSION?" -n 1 -r
32+
#echo

0 commit comments

Comments
 (0)