From 92403239b79544eb5a13cca010684acea1e6d5cc Mon Sep 17 00:00:00 2001 From: sbstjn Date: Sat, 20 Feb 2021 23:45:51 +0100 Subject: [PATCH] feat: update github actions --- .github/workflows/integration.yml | 28 ++++---------- .github/workflows/release.yml | 64 +++++++++++++++++++++++++++++++ package.json | 1 + 3 files changed, 72 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 12f45cd4..4adf7bdd 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -1,6 +1,12 @@ name: Integration -on: [push] +on: + push: + branches: + - '*' + - '*/*' + - '**' + - '!main' jobs: build: @@ -39,23 +45,3 @@ jobs: - run: yarn - run: yarn test - version: - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/main' - needs: - - build - - test - steps: - - uses: actions/checkout@v2 - - - uses: cycjimmy/semantic-release-action@v2 - name: Semantic Release - timeout-minutes: 2 - id: semantic - with: - extra_plugins: | - @semantic-release/git - @semantic-release/changelog - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..d1031dac --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,64 @@ +name: Integration + +on: + push: + branches: + - 'main' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - uses: actions/cache@v2 + with: + path: '**/node_modules' + key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} + + - uses: actions/setup-node@v2-beta + with: + node-version: '12' + + - run: yarn + + - run: yarn build + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - uses: actions/cache@v2 + with: + path: '**/node_modules' + key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} + + - uses: actions/setup-node@v2-beta + with: + node-version: '12' + + - run: yarn + + - run: yarn test + version: + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + needs: + - build + - test + steps: + - uses: actions/checkout@v2 + + - uses: cycjimmy/semantic-release-action@v2 + name: Semantic Release + timeout-minutes: 2 + id: semantic + with: + extra_plugins: | + @semantic-release/git + @semantic-release/changelog + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index 3cc20d81..e2fa99ec 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "test": "jest", "cdk": "cdk", "deploy": "cdk deploy", + "format": "yarn prettier-format", "prettier-format": "prettier --config .prettierrc 'aws/**/*.ts' --write", "prettier-watch": "onchange 'aws/**/*.ts' -- prettier --write {{changed}}" },