Skip to content

Commit

Permalink
Remove generated distributions files from git
Browse files Browse the repository at this point in the history
- Move all ci tests from travis to github actions
- Remove generated distributions in dist directory from git
- Adapt release howto
- Fix packaging, some packages contained unnecessary files

Motivation

Removing the generated distribution files from git, removes some complexity from the build and publish process,
because it's not required anymore to generate and commit distributions when bumping and tagging the version.
It's only required to change the version in the package.json and set a git tag, what is done by lerna version.
I hope, this pr is not breaking anything, but the packaged tars should look pretty much the same.

The PR is the next step to make the publish process more robust, less error prone and a preparation for moving it to ci.
  • Loading branch information
pithu committed Oct 23, 2021
1 parent 5e92090 commit a5018fa
Show file tree
Hide file tree
Showing 149 changed files with 361 additions and 187,386 deletions.
2 changes: 1 addition & 1 deletion packages/locale/.editorconfig → .editorconfig
Expand Up @@ -8,7 +8,7 @@ charset = utf-8

[**.{json,styl,jade,yaml,yml}]
indent_style = space
indent_size = 4
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/release.yaml
@@ -0,0 +1,11 @@
name: Release

on:
release

jobs:
build:
name: 'test release'
runs-on: ubuntu-latest
steps:
- run: echo "Hello release";
54 changes: 0 additions & 54 deletions .github/workflows/saucelabs-test.yaml

This file was deleted.

106 changes: 106 additions & 0 deletions .github/workflows/tests.yaml
@@ -0,0 +1,106 @@
name: js-joda build and test

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build-test:
name: Build and test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup node 14
uses: actions/setup-node@v2
with:
node-version: '14'
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.OS }}-node-
- name: Install and bootstrap
run: |
npm install;
npx lerna clean -y;
npx lerna link;
npx lerna bootstrap --no-ci;
- name: Build
run: |
set -e;
npx lerna run --stream build-dist;
npx lerna run --stream build-locale-dist;
- name: Test
run: |
npx lerna run --stream lint;
npm run build-esdoc;
npx lerna run --stream test;
npx lerna run --stream test-ts-definitions;
npx lerna run --stream test-coverage;
npx lerna run --concurrency 1 --stream test-browser -- -- --browserNoActivityTimeout 20000;
npm run build-test-coverage-report;
- name: Push coverage to coveralls
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
cat ./build/coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js;
sauce:
name: Saucelabs Tests (non forked pr's only)
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup node 14
uses: actions/setup-node@v2
with:
node-version: '14'
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.OS }}-node-
- name: Setup sauce connect
uses: saucelabs/sauce-connect-action@v1
with:
username: ${{ secrets.SAUCE_USERNAME }}
accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
tunnelIdentifier: github-action-tunnel
scVersion: 4.6.4
- name: Install and bootstrap
run: |
npm install;
npx lerna clean -y;
npx lerna link;
npx lerna bootstrap --no-ci;
- name: Build
run: |
set -e;
npx lerna run --stream build-dist;
npx lerna run --stream build-locale-dist;
- name: karma tests with sauce
env:
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
run: |
set -e;
npx lerna run --stream test-saucelabs;
# dump-env:
# name: Dump environment and context
# runs-on: ubuntu-latest
# if: ${{ false }}
# steps:
# - name: dump github context
# env:
# GITUB_CONTEXT: ${{ toJson(github) }}
# run: echo "$GITUB_CONTEXT"
# - name: dump default env
# run: export
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -7,6 +7,7 @@ yarn.lock

# build output
build
dist
tmp
.nyc_output

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion ReleaseHowTo.md
Expand Up @@ -16,6 +16,6 @@ $ git pull
$ git add . && git reset --hard origin/master # ensure that there are no un-staged or un-commited local changes
$ lerna run --stream test-ci # verify that the current state of the master branch is green
# Update and commit CHANGELOG'S manually, 'npx lerna-changelog' can help
$ lerna version --no-private --no-granular-pathspec [major | minor | patch]
$ lerna version --no-private [major | minor | patch]
$ lerna publish from-git
```
2 changes: 1 addition & 1 deletion docs/inject/script/0-yato.js
Expand Up @@ -6,4 +6,4 @@ for(var prop in JSJodaLocale) { window[prop] = JSJodaLocale[prop]; }
console.log("Welcome to js-joda at '"+ LocalDateTime.now().toString() + "' local time.");
console.log("An example with @js-joda/timezone: Its '"+ LocalDateTime.now().atZone(ZoneId.systemDefault()).toString() + "' system default timezone.");
console.log("An example with @js-joda/extra: Interval of 1 minute '"+ JSJodaExtra.Interval.of(Instant.now(), Duration.ofMinutes(1)).toString() + ".");
console.log("An example with @js-joda/local: ZonedDateTime with locale format en-us '"+ JSJoda.ZonedDateTime.of(2017, 1, 1, 0, 0, 0, 0, JSJoda.ZoneId.of('Europe/Berlin')).format(JSJoda.DateTimeFormatter.ofPattern('eeee MMMM dd yyyy GGGG, hh:mm:ss a zzzz, zz, OOOO \'Week: \' ww, \'Quarter: \' QQQ').withLocale(Locale.US)) + ".");
console.log("An example with @js-joda/locale: ZonedDateTime with locale format en-us '"+ JSJoda.ZonedDateTime.of(2017, 1, 1, 0, 0, 0, 0, JSJoda.ZoneId.of('Europe/Berlin')).format(JSJoda.DateTimeFormatter.ofPattern('eeee MMMM dd yyyy GGGG, hh:mm:ss a zzzz, zz, OOOO \'Week: \' ww, \'Quarter: \' QQQ').withLocale(Locale.US)) + ".");
13 changes: 13 additions & 0 deletions esdoc/git-push-on-change.sh
@@ -0,0 +1,13 @@
#!/bin/bash
git add docs
set +e # Grep succeeds with nonzero exit codes to show results.
git status | grep modified
if [ $? -eq 0 ]
then
set -e
git commit -m "docs updated on - $(date)" || true
git push || true
else
set -e
echo "No changes since last run"
fi
2 changes: 1 addition & 1 deletion esdoc/yato.js
Expand Up @@ -6,4 +6,4 @@ for(var prop in JSJodaLocale) { window[prop] = JSJodaLocale[prop]; }
console.log("Welcome to js-joda at '"+ LocalDateTime.now().toString() + "' local time.");
console.log("An example with @js-joda/timezone: Its '"+ LocalDateTime.now().atZone(ZoneId.systemDefault()).toString() + "' system default timezone.");
console.log("An example with @js-joda/extra: Interval of 1 minute '"+ JSJodaExtra.Interval.of(Instant.now(), Duration.ofMinutes(1)).toString() + ".");
console.log("An example with @js-joda/local: ZonedDateTime with locale format en-us '"+ JSJoda.ZonedDateTime.of(2017, 1, 1, 0, 0, 0, 0, JSJoda.ZoneId.of('Europe/Berlin')).format(JSJoda.DateTimeFormatter.ofPattern('eeee MMMM dd yyyy GGGG, hh:mm:ss a zzzz, zz, OOOO \'Week: \' ww, \'Quarter: \' QQQ').withLocale(Locale.US)) + ".");
console.log("An example with @js-joda/locale: ZonedDateTime with locale format en-us '"+ JSJoda.ZonedDateTime.of(2017, 1, 1, 0, 0, 0, 0, JSJoda.ZoneId.of('Europe/Berlin')).format(JSJoda.DateTimeFormatter.ofPattern('eeee MMMM dd yyyy GGGG, hh:mm:ss a zzzz, zz, OOOO \'Week: \' ww, \'Quarter: \' QQQ').withLocale(Locale.US)) + ".");

0 comments on commit a5018fa

Please sign in to comment.