Skip to content

Commit

Permalink
Merge pull request #1 from edx/michaelroytman/MST-2030-initial-setup
Browse files Browse the repository at this point in the history
Set up initial repository documentation and infrastructure.
  • Loading branch information
MichaelRoytman authored Aug 3, 2023
2 parents 4d9d131 + c73e10b commit 987a3c7
Show file tree
Hide file tree
Showing 14 changed files with 6,369 additions and 765 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Default CI
on:
push:
branches:
- 'master'
- 'main'
pull_request:
branches:
- '**'
Expand All @@ -23,6 +23,8 @@ jobs:
node-version: ${{ env.NODE_VER }}
- name: Install dependencies
run: npm ci
- name: Validate package-lock.json changes
run: make validate-no-uncommitted-package-lock-changes
- name: Lint
run: npm run lint
- name: Test
Expand All @@ -33,3 +35,12 @@ jobs:
run: npm run i18n_extract
- name: Coverage
uses: codecov/codecov-action@v3
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Preview semantic-release version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }}
run: npx semantic-release --dry-run --branches=${{ steps.extract_branch.outputs.branch }}
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release
on:
push:
branches:
- main
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Nodejs Env
run: echo "NODE_VER=`cat .nvmrc`" >> $GITHUB_ENV

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VER }}

- name: Install dependencies
run: npm ci
- name: Test
run: npm run test
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }}
run: npx semantic-release
27 changes: 27 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"branch": "main",
"tagFormat": "v${version}",
"verifyConditions": [
"@semantic-release/npm",
{
"path": "@semantic-release/github",
"assets": {
"path": "dist/*"
}
}
],
"analyzeCommits": "@semantic-release/commit-analyzer",
"generateNotes": "@semantic-release/release-notes-generator",
"prepare": "@semantic-release/npm",
"publish": [
"@semantic-release/npm",
{
"path": "@semantic-release/github",
"assets": {
"path": "dist/*"
}
}
],
"success": [],
"fail": []
}
2 changes: 1 addition & 1 deletion .tx/config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[main]
host = https://www.transifex.com

[o:open-edx:p:edx-platform:r:frontend-template-application]
[o:open-edx:p:edx-platform:r:frontend-lib-learning-assistant]
file_filter = src/i18n/messages/<lang>.json
source_file = src/i18n/transifex_input.json
source_lang = en
Expand Down
19 changes: 16 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export TRANSIFEX_RESOURCE = frontend-template-application
export TRANSIFEX_RESOURCE = frontend-lib-learning-assistant
transifex_langs = "ar,fr,es_419,zh_CN"

intl_imports = ./node_modules/.bin/intl-imports.js
Expand All @@ -9,6 +9,14 @@ transifex_input = $(i18n)/transifex_input.json
# This directory must match .babelrc .
transifex_temp = ./temp/babel-plugin-react-intl

build:
rm -rf ./dist
./node_modules/.bin/fedx-scripts babel src --out-dir dist --source-maps --ignore **/*.test.jsx,**/*.test.js,**/setupTest.js --copy-files
@# --copy-files will bring in everything else that wasn't processed by babel. Remove what we don't want.
@find dist -name '*.test.js*' -delete
rm ./dist/setupTest.js
@rm -rf dist/**/__snapshots__

precommit:
npm run lint
npm audit
Expand Down Expand Up @@ -57,7 +65,12 @@ pull_translations:
translations/paragon/src/i18n/messages:paragon \
translations/frontend-component-footer/src/i18n/messages:frontend-component-footer \
translations/frontend-component-header/src/i18n/messages:frontend-component-header \
translations/frontend-template-application/src/i18n/messages:frontend-template-application
translations/frontend-lib-learning-assistant/src/i18n/messages:frontend-lib-learning-assistant

$(intl_imports) paragon frontend-component-header frontend-component-footer frontend-template-application
$(intl_imports) paragon frontend-component-header frontend-component-footer frontend-lib-learning-assistant
endif

# This target is used by GitHub Actions.
validate-no-uncommitted-package-lock-changes:
# Checking for package-lock.json changes...
git diff --exit-code package-lock.json
259 changes: 0 additions & 259 deletions README-template-frontend-app.rst

This file was deleted.

Loading

0 comments on commit 987a3c7

Please sign in to comment.