Skip to content

Commit 65f24eb

Browse files
committed
Publish latest and tags to AWS S3
This recreates the logic from this removed TravisCI job: https://github.com/handlebars-lang/handlebars.js/blob/a9a8e403213583ca90cb7c872d3a22796c37d961/.travis.yml#L16-L25
1 parent 35f0018 commit 65f24eb

File tree

3 files changed

+34
-9
lines changed

3 files changed

+34
-9
lines changed

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
tags:
8+
- '*'
9+
10+
jobs:
11+
publish-aws-s3:
12+
name: Publish to AWS S3
13+
runs-on: 'ubuntu-latest'
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v2
20+
with:
21+
node-version: '18'
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
26+
- name: Publish
27+
run: npm run publish:aws
28+
env:
29+
# Note: the environment secrets `S3_ACCESS_KEY_ID`
30+
# and `S3_SECRET_ACCESS_KEY` have to be set!
31+
S3_BUCKET_NAME: "builds.handlebarsjs.com"

Gruntfile.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,6 @@ module.exports = function (grunt) {
156156
'copy:components',
157157
]);
158158

159-
// Requires secret properties from .travis.yaml
160-
grunt.registerTask('extensive-tests-and-publish-to-aws', [
161-
'default',
162-
'shell:integrationTests',
163-
'metrics',
164-
'publish-to-aws',
165-
]);
166-
167159
grunt.registerTask('on-file-change', ['build', 'concat:tests', 'test']);
168160

169161
// === Primary tasks ===

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,19 @@
7979
},
8080
"scripts": {
8181
"build": "grunt build",
82+
"release": "grunt release",
83+
"publish:aws": "npm run test:tasks && grunt && grunt publish-to-aws",
8284
"format": "prettier --write '**/*.js' && eslint --fix .",
8385
"lint": "npm run lint:eslint && npm run lint:prettier && npm run lint:types",
8486
"lint:eslint": "eslint --max-warnings 0 .",
8587
"lint:prettier": "prettier --check '**/*.js'",
8688
"lint:types": "dtslint types",
8789
"test": "npm run test:mocha",
8890
"test:mocha": "grunt build && grunt test",
91+
"test:tasks": "mocha tasks/tests/",
8992
"test:browser": "playwright test --config tests/browser/playwright.config.js",
9093
"test:integration": "grunt integration-tests",
9194
"test:serve": "grunt connect:server:keepalive",
92-
"extensive-tests-and-publish-to-aws": "npx mocha tasks/tests/ && grunt --stack extensive-tests-and-publish-to-aws",
9395
"--- combined tasks ---": "",
9496
"check-before-pull-request": "concurrently --kill-others-on-fail npm:lint npm:test"
9597
},

0 commit comments

Comments
 (0)