Skip to content

Commit

Permalink
🚀 Release 2.1.0 (#732)
Browse files Browse the repository at this point in the history
Co-authored-by: Florian <hi@florianpanchout.com>
Co-authored-by: Paul Souche <paul@bettercallpaul.fr>
Co-authored-by: Lilian Saget-Lethias <lilian.sagetlethias@gmail.com>
Co-authored-by: Paul Souche <paul.souche@gmail.com>
  • Loading branch information
5 people authored Oct 3, 2024
1 parent e686f0a commit f2d6e91
Show file tree
Hide file tree
Showing 182 changed files with 1,921 additions and 1,172 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/create-release-note.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Create Release Notes

on:
push:
branches:
- main

jobs:
create_github_release:
name: Create GitHub release
runs-on: ubuntu-latest
# We create release only if the version in the package.json have been upgraded and this CI is running against the main branch.
# We allow branches with a PR open on main to publish pre-release (x.y.z-rc.u) but not actual releases.
if: |
needs.check_if_version_upgraded.outputs.from_version != needs.check_if_version_upgraded.outputs.to_version
needs:
- check_if_version_upgraded
steps:
- uses: softprops/action-gh-release@v1
with:
name: Release v${{ needs.check_if_version_upgraded.outputs.to_version }}
tag_name: v${{ needs.check_if_version_upgraded.outputs.to_version }}
target_commitish: ${{ github.head_ref || github.ref }}
generate_release_notes: true
draft: false
prerelease: ${{ needs.check_if_version_upgraded.outputs.is_pre_release == 'true' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,33 +1,74 @@
# This CI is triggered each time a workflow named "Generate PR artifact" is
# completed. It retrieves the artifact containing the result of the `yarn
# compile` command, and update/create a new comment on the corresponding PR.
# Generates an artifact containing the result of the translations status of the UI.
#
# TODO: to factorize with the model's CI.

name: Update PR comments
name: Generate PR comment

on:
workflow_run:
workflows: ['Generate PR artifact']
types: [completed]

permissions:
contents: read
pull-requests: write
pull_request:
types: [opened, synchronize]
push:
branches:
- '!main'
- '!preprod'

jobs:
pr_comment:
runs-on: ubuntu-latest
compile:
runs-on: ubuntu-22.04
outputs:
check-ui-result: ${{ steps.check-ui.outputs.result }}
check-faq-result: ${{ steps.check-faq.outputs.result }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Downloading Artifacts from Previous Workflow...
uses: dawidd6/action-download-artifact@v6
- uses: actions/checkout@v2
- run: git log | head && git status
- uses: actions/setup-node@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
node-version: '20'
cache: 'yarn'
- run: yarn install --immutable
shell: bash
- run: yarn ui:check
- run: yarn faq:check
- id: check-ui
run: |
# Checks the translation of the UI's texts
body="$(yarn ui:check --markdown 2> /dev/null | tail --lines=+7 | head --lines=-1)"
body="${body//'%'/'%25'}"
body="${body//$'\n'/'%0A'}"
body="${body//$'\r'/'%0D'}"
echo "::set-output name=result::${body}"
- id: check-faq
run: |
# Checks the translation of FAQ's questions
body="$(yarn faq:check --markdown 2> /dev/null | tail --lines=+3 | head --lines=-1)"
body="${body//'%'/'%25'}"
body="${body//$'\n'/'%0A'}"
body="${body//$'\r'/'%0D'}"
echo "::set-output name=result::${body}"
generate-pr-comment:
runs-on: ubuntu-22.04
needs: compile
steps:
- name: Create artifact
run: |
echo "
<h1 align="center">Report for the pull request #${{ github.event.pull_request.number }}</h1>
---
### :globe_with_meridians: Translation status
#### UI's texts
${{ needs.compile.outputs.check-ui-result }}
#### FAQ's questions
${{ needs.compile.outputs.check-faq-result }}
> _You will find more information about the translation in the dedicated file._
" > result.md
- name: Updating the PR
uses: actions/github-script@v6
with:
Expand All @@ -36,25 +77,19 @@ jobs:
const fs = require('fs');
const {owner, repo} = context.repo;
const run_id = context.payload.workflow_run.id;
core.info('Triggered workflow run:', run_id);
const pull_requests = await github.rest.pulls.list(context.repo);
if (!pull_requests.data.length) {
return core.error("Currently, there is no open PR.");
}
core.info('Found ' + pull_requests.data.length + ' PR');
var triggered_pr;
for (const pr of pull_requests.data) {
if (pr.head.sha == context.payload.workflow_run.head_sha) {
triggered_pr = pr;
}
}
if (!triggered_pr) {
return core.error('The corresponding RP could not be found.');
const triggered_pr = context.payload.pull_request;
if (!triggered_pr) {
return core.error('The corresponding PR could not be found.');
}
core.info('Found the corresponding PR: #' + triggered_pr.number);
const marker = 'yarn-compile-result';
Expand Down
77 changes: 0 additions & 77 deletions .github/workflows/upload-translation-status.yaml

This file was deleted.

3 changes: 2 additions & 1 deletion cypress/e2e/integration/pages/groupes.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ describe('The Group creation page /amis/creer', () => {
cy.get('[data-cypress-id="group-name"]')

// Check that the main sections are displayed
cy.get('[data-cypress-id="points-fort-faibles-title"]')
// TODO: improve test to handle checking the display of the points forts and faibles
// cy.get('[data-cypress-id="points-fort-faibles-title"]')
cy.get('[data-cypress-id="votre-empreinte-title"]')

let currentUrl = ''
Expand Down
38 changes: 32 additions & 6 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ const redirects = require('./config/redirects.js')

const remoteImagesPatterns = require('./config/remoteImagesPatterns.js')

// const { sentryWebpackPlugin } = require('@sentry/webpack-plugin')

/** @type {import('next').NextConfig} */
const nextConfig = {
pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'],
Expand All @@ -21,12 +23,20 @@ const nextConfig = {
async redirects() {
return redirects
},
webpack: (config) => {
webpack: (config, { dev, isServer }) => {
if (config.cache) {
config.cache = Object.freeze({
type: 'memory',
})
config.cache.maxMemoryGenerations = 0
if (dev) {
// Development configuration
config.cache = {
type: 'filesystem',
}
} else {
// Use cache in production
config.cache = Object.freeze({
type: 'memory',
})
config.cache.maxMemoryGenerations = 0
}
}

// Add a rule for YAML files
Expand All @@ -35,8 +45,24 @@ const nextConfig = {
use: 'yaml-loader',
})

// Enable source maps
if (!dev && !isServer) {
config.devtool = 'source-map'
}

// if (process.env.SENTRY_AUTH_TOKEN) {
// config.plugins.push(
// sentryWebpackPlugin({
// authToken: process.env.SENTRY_AUTH_TOKEN_SOURCEMAPS,
// org: 'betagouv',
// project: 'nosgestesclimat-nextjs',
// })
// )
// }

return config
},
productionBrowserSourceMaps: true,
experimental: {
outputFileTracingExcludes: {
'*': ['.next/cache/webpack', '.git/**/*', 'cypress/**/*'],
Expand Down Expand Up @@ -82,7 +108,7 @@ const sentryConfig = [
tunnelRoute: '/monitoring',

// Hides source maps from generated client bundles
hideSourceMaps: true,
hideSourceMaps: false,

// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "nosgestesclimat-site-nextjs",
"license": "MIT",
"version": "2.0.0",
"version": "2.1.0",
"description": "The leading open source climate footprint calculator",
"repository": {
"type": "git",
Expand All @@ -19,6 +19,7 @@
"build:debug-memory": "next build --experimental-debug-memory-usage",
"start": "next start",
"lint": "next lint",
"lint:types": "tsc --noEmit",
"e2e": "cypress open --e2e",
"e2e:generate": "node cypress/scripts/generateSpecsFromPersonas.mjs",
"ui:parse": "node scripts/i18n/generate-ui.js",
Expand All @@ -33,7 +34,7 @@
"dependencies": {
"@babel/runtime": "^7.23.1",
"@incubateur-ademe/legal-pages-react": "^0.2.0",
"@incubateur-ademe/nosgestesclimat": "^3.1.1",
"@incubateur-ademe/nosgestesclimat": "^3.2.0",
"@mdx-js/loader": "^3.0.0",
"@mdx-js/react": "^3.0.0",
"@next/bundle-analyzer": "^14.1.0",
Expand All @@ -57,6 +58,7 @@
"i18next-browser-languagedetector": "^7.2.0",
"i18next-parser": "^8.13.0",
"i18next-resources-to-backend": "^1.2.0",
"is-mobile": "^4.0.0",
"jest": "^29.7.0",
"markdown-to-jsx": "^7.3.2",
"next": "^14.2.7",
Expand Down Expand Up @@ -94,6 +96,7 @@
"@babel/runtime": "^7.23.1",
"@faker-js/faker": "^8.4.1",
"@incubateur-ademe/nosgestesclimat-scripts": "^0.6.0",
"@sentry/webpack-plugin": "^2.22.4",
"@simonsmith/cypress-image-snapshot": "^9.0.1",
"@types/mdx": "^2.0.10",
"@types/mocha": "^10.0.6",
Expand Down
3 changes: 0 additions & 3 deletions public/images/icons/action.svg

This file was deleted.

3 changes: 0 additions & 3 deletions public/images/icons/answers.svg

This file was deleted.

3 changes: 0 additions & 3 deletions public/images/icons/book-closed.svg

This file was deleted.

Loading

0 comments on commit f2d6e91

Please sign in to comment.