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

Feature/issue 45 #49

Merged
merged 5 commits into from
Oct 18, 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
10 changes: 9 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@
"jest": true
},
"extends": ["eslint:recommended", "plugin:react/recommended", "plugin:prettier/recommended"],
"overrides": [],
"overrides": [
{
"files": ["config-overrides.js", "renameBuildFiles.js"],
"rules": {
"no-undef": "off",
"no-unused-vars": "off"
}
}
],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/build-staging-deploy-s3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,25 @@ on:
branches:
- develop
jobs:
release:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
cache: 'npm'

- name: Install dependencies
run: npm install

- name: Run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
deploy:
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY_ID }}
Expand All @@ -18,3 +37,4 @@ jobs:
- run: npm install
- run: npm run build:staging
- run: aws s3 sync ./build s3://${{env.WEBHOSTING_BUCKET_NAME}}/ --acl public-read --delete --cache-control max-age=3600

10 changes: 10 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"branches": ["main", "develop"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/npm",
"@semantic-release/git"
]
}
16 changes: 16 additions & 0 deletions config-overrides.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const { version } = require('./package.json');

const [major] = version.split('.');

module.exports = function override(config, env) {
config.output.filename = `static/js/widget-${major}.js`;

const miniCssExtractPlugin = config.plugins.find(
(plugin) => plugin.constructor.name === 'MiniCssExtractPlugin',
);
if (miniCssExtractPlugin) {
miniCssExtractPlugin.options.filename = `static/css/widget-${major}.css`;
}

return config;
};
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 13 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "calendar-widget",
"version": "0.1.0",
"version": "0.1.1",
"private": true,
"homepage": ".",
"dependencies": {
Expand All @@ -21,12 +21,12 @@
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"start:staging": "env-cmd -f .env.staging react-scripts start",
"start:production": "env-cmd -f .env.production react-scripts start",
"build:staging": "env-cmd -f .env.staging react-scripts build",
"build:production": "env-cmd -f .env.production react-scripts build",
"test": "react-scripts test",
"start": "react-app-rewired start",
"start:staging": "env-cmd -f .env.staging react-app-rewired start",
"start:production": "env-cmd -f .env.production react-app-rewired start",
"build:staging": "env-cmd -f .env.staging react-app-rewired build",
"build:production": "env-cmd -f .env.production react-app-rewired build",
"test": "react-app-rewired test",
"eject": "react-scripts eject",
"lint": "eslint .",
"lint:fix": "eslint --fix",
Expand Down Expand Up @@ -55,10 +55,15 @@
]
},
"devDependencies": {
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@semantic-release/npm": "^12.0.1",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.2",
"eslint-plugin-react": "^7.33.2",
"prettier": "^3.1.1"
"prettier": "^3.1.1",
"react-app-rewired": "^2.2.1",
"semantic-release": "^24.1.2"
}
}