Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INFRA-552: add release workflow #2

Merged
merged 2 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
FORCE_COLOR: 1
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3.6.0
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Install
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release

on:
push:
branches:
- master

jobs:
main:
runs-on: ubuntu-latest
environment: npm
env:
FORCE_COLOR: 1
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://registry.npmjs.org
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Test
run: |
yarn lint
yarn test
- name: Publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.LIFEOMIC_NPM_TOKEN }}
run: |
yarn build
npx semantic-release
npm access grant read-only lifeomic:readonly-developers '@lifeomic/turbo-remote-cache'
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
dist/
node_modules/
node_modules/
*.tgz
13 changes: 12 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,22 @@
"version": "0.0.0",
"license": "MIT",
"description": "remote cache server for turbo repo",
"bin": {
"start-turbo-cache-server": "dist/bin/start_server.js"
},
"files": [
"dist/bin/*",
"dist/src/*",
"package.json",
"README.md"
],
"scripts": {
"build": "tsc",
"start": "pm2 start dist/bin/start_server.js --name turbo-cache",
"stop": "pm2 stop turbo-cache",
"ts-type-check": "",
"clean": "rm -rf ./dist",
"lint": "eslint --cache --cache-location node_modules/.cache/.eslintcache --ext .ts,.tsx,.js,.jsx . --max-warnings 0",
"lint": "eslint --cache --cache-location node_modules/.cache/.eslintcache --ext .ts . --max-warnings 0",
"prettier": "prettier",
"test": "jest --silent"
},
Expand All @@ -29,9 +38,11 @@
"@typescript-eslint/parser": "^6.17.0",
"aws-sdk-client-mock": "^3.0.0",
"aws-sdk-client-mock-jest": "^3.0.0",
"conventional-changelog-conventionalcommits": "^5.0.0",
"eslint": "^8.56.0",
"jest": "^29.7.0",
"pm2": "^4.0.0",
"semantic-release": "^19.0.3",
"supertest": "^6.3.3",
"ts-node": "^8.0.2",
"typescript": "^5.3.2"
Expand Down
16 changes: 16 additions & 0 deletions release.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
branches: ['master'],
plugins: [
['@semantic-release/commit-analyzer', { preset: 'conventionalcommits' }],
['@semantic-release/npm', { pkgRoot: 'dist/' }],
[
'@semantic-release/github',
{
// Setting this to false disables the default behavior
// of opening a GitHub issue when a release fails.
// We can enable this later if we want.
failComment: false,
},
],
],
};
Loading