Skip to content

Commit e18cd2f

Browse files
committed
[patch] fix release.sh
2 problems: - the s3 publishes should not have had acl (i got this from what was there before) - the npm publish needs a valid token
1 parent 5459f83 commit e18cd2f

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

.github/workflows/build-push.yml

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

28+
- name: Write version to files
29+
run: |
30+
./deployment/write-versions.sh ${{ steps.next-version.outputs.result }}
31+
2832
- name: Install dependencies
2933
run: npm run ci
3034

@@ -100,11 +104,6 @@ jobs:
100104
env:
101105
INPUT_SHA: ${{ env.INPUT_SHA }}
102106

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-
108107
- name: Deploy updated builds to staging
109108
if: ${{ github.ref == 'refs/heads/master' }}
110109
id: build

.github/workflows/deploy-release.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,16 @@ jobs:
6868
- name: Configure NPM
6969
run: npm ci
7070

71-
- name: Release to npm, s3, prod
71+
- run: make release
72+
73+
- name: Publish to s3
7274
run: |
73-
./deployment/release.sh ${{ steps.next-version.outputs.result }}
75+
./deployment/release-s3.sh ${{ steps.next-version.outputs.result }}
76+
77+
- name: Publish to npm
78+
env:
79+
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISHER_TOKEN }}
80+
run: npm publish
7481

7582
- name: Create Github Release
7683
uses: actions/github-script@v7
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ 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.min.js.gz s3://branch-cdn/branch-$VERSION.min.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-latest.min.js --cache-control "max-age=300"
1819

1920
echo -en "Invalidating cloudfront distribution...\n"
2021
aws configure set preview.cloudfront true
2122
aws cloudfront create-invalidation --distribution-id E10P37NG0GMER --paths /branch-latest.min.js
2223

23-
npm publish
2424

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

0 commit comments

Comments
 (0)