Skip to content

Commit

Permalink
use different release strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
Gozala committed Oct 20, 2020
1 parent bd5f541 commit 3fc54f3
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 24 deletions.
23 changes: 1 addition & 22 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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 }}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "typescript-error-reporter-action",
"version": "1.0.0",
"main": "lib/index.js",
"main": "dist/index.js",
"author": "andoshin11 <[email protected]>",
"license": "MIT",
"repository": {
Expand All @@ -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"
},
Expand Down

0 comments on commit 3fc54f3

Please sign in to comment.