diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b18e842..607427b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -39,25 +39,4 @@ jobs: uses: ./ with: project: projectFixtures/sub - publish: - name: Release - needs: test - runs-on: ubuntu-latest - if: github.event_name == 'push' && github.ref == 'refs/heads/default' - steps: - - uses: actions/checkout@v2 - - name: Restore dependencies - id: cache-modules - uses: actions/cache@v1 - with: - path: node_modules - key: 12.x-${{ runner.OS }}-build-${{ hashFiles('package.json') }} - - name: Install - if: steps.cache-modules.outputs.cache-hit != 'true' - run: yarn install - - name: Build - uses: tool3/ncc@master - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - src: 'src/index.ts' - branch: release + \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..b68e5ef --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,34 @@ +name: Release + +on: + release: + types: [published, edited] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [13.x] + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + ref: ${{ github.event.release.tag_name }} + - name: Restore dependencies + id: cache-modules + uses: actions/checkout@v2 + with: + path: node_modules + key: ${{ matrix.node-version }}-${{ runner.OS }}-build-${{ hashFiles('package.json') }} + - name: Install dependencies + if: steps.cache-modules.outputs.cache-hit != 'true' + run: npm install + - name: Build + run: npm run build + - Release + uses: JasonEtco/build-and-tag-action@v1 + with: + setup: '' + env: + GITHUB_TOKEN: ${{ github.token }} diff --git a/package.json b/package.json index 3c0fcef..d9be7b9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "typescript-error-reporter-action", "version": "1.0.0", - "main": "lib/index.js", + "main": "dist/index.js", "author": "andoshin11 ", "license": "MIT", "repository": { @@ -13,13 +13,13 @@ }, "homepage": "https://github.com/gozala/typescript-error-reporter-action#readme", "scripts": { + "start": "npx @vercel/ncc run ./src/index.ts", "build": "npx @vercel/ncc build src/index.ts", "watch": "tsc -w", "clean": "rm -rf lib && rm -rf dist", "test:type": "tsc --noEmit --incremental false" }, "devDependencies": { - "@types/glob": "^7.1.3", "@types/node": "^14.11.8", "typescript": "^4.0.3" },