From c742411f2907be6a576252fc27300b54664c5702 Mon Sep 17 00:00:00 2001 From: Kam Lasater Date: Thu, 24 Nov 2022 21:26:03 -0500 Subject: [PATCH] fix(cicd): added auto release --- .github/workflows/merge_main.yaml | 12 ------------ .github/workflows/release.yaml | 21 +++++++++++++++++++++ package.json | 5 +++++ 3 files changed, 26 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/merge_main.yaml b/.github/workflows/merge_main.yaml index 26f7356..0cb4973 100644 --- a/.github/workflows/merge_main.yaml +++ b/.github/workflows/merge_main.yaml @@ -21,15 +21,3 @@ jobs: run: | npm ci npm run test - - id: publish - uses: JS-DevTools/npm-publish@v1 - with: - token: ${{ secrets.NPM_TOKEN }} - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ steps.publish.outputs.version }} - release_name: ${{ steps.publish.outputs.version }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..ac69fde --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,21 @@ +name: Release +"on": + push: + branches: + - main +jobs: + release: + name: release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + cache: npm + node-version: 16 + - run: npm ci + - run: npm run test + - run: npx semantic-release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index 010af39..1bb2979 100644 --- a/package.json +++ b/package.json @@ -39,5 +39,10 @@ "dependencies": { "@aws-sdk/client-dynamodb": "3.82.0", "@aws-sdk/lib-dynamodb": "3.82.0" + }, + "release": { + "branches": [ + "main" + ] } }