diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9f96757..7e93713 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,12 +13,27 @@ jobs: node-version: '12' - name: "install dependencies" run: npm ci + - name: "create VERSION file" + if: ${{ env.IS_RELEASE_BRANCH == 'true' }} + run: | + source ./scripts/setup-git.sh "$RELEASE_DEPLOY_KEY" + echo $GITHUB_REPOSITORY_SSH_URL + npx semantic-release -r $GITHUB_REPOSITORY_SSH_URL -d + echo "Next release version is $(cat VERSION)" + env: + RELEASE_DEPLOY_KEY: ${{ secrets.RELEASE_DEPLOY_KEY }} + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - name: "Lint" run: npm run lint - name: "test" run: npm run test - name: "build" - run: npm run build + run: | + if [ -f VERSION ]; then + npm version --no-git-tag-version $(cat VERSION) --allow-same-version + fi + npm run build + docker build -f ./docker/Dockerfile -t $TMP_DOCKER_IMAGE . - name: "release" if: ${{ env.IS_RELEASE_BRANCH == 'true' }} run: | diff --git a/.gitignore b/.gitignore index f1f6dbc..022090b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,35 @@ -.idea/ -node_modules/ -build/ -tmp/ -*.log +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +.idea/* +!.idea/runConfigurations + +# deps +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# production +/build + +# misc +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +dist +build +tmp +tmp.* +data +*.iml +*.env +*.tgz diff --git a/src/commands/upload/ci/get-branch.spec.ts b/src/commands/upload/ci/get-branch.spec.ts index 65909ba..e2f5dcd 100644 --- a/src/commands/upload/ci/get-branch.spec.ts +++ b/src/commands/upload/ci/get-branch.spec.ts @@ -1,4 +1,3 @@ -import 'reflect-metadata'; import { getBranch } from './get-branch'; describe('getCurrentBranchNameInCiEnvironment', () => {