Skip to content
This repository was archived by the owner on Jan 2, 2022. It is now read-only.

Commit c1e4130

Browse files
committed
ci(publish): setup automatic publishing
Signed-off-by: Jonah Snider <[email protected]>
1 parent 6b9a6e5 commit c1e4130

File tree

2 files changed

+35
-38
lines changed

2 files changed

+35
-38
lines changed

.github/workflows/ci.yml

Lines changed: 33 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,18 @@ jobs:
1616
- name: Setup Node.js for use with Actions
1717
uses: actions/setup-node@v1
1818
with:
19-
node-version: '12.14.1'
19+
node-version: '12.16.0'
2020
- name: Install Yarn
2121
run: curl -o- -L https://yarnpkg.com/install.sh | bash
22-
- name: Get yarn cache
23-
id: yarn-cache
24-
run: echo "::set-output name=dir::$(yarn cache dir)"
25-
- name: Cache dependencies
26-
uses: actions/cache@v1
27-
with:
28-
path: ${{ steps.yarn-cache.outputs.dir }}
29-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
30-
restore-keys: |
31-
${{ runner.os }}-yarn-
3222
- name: Install dependencies with Yarn
3323
run: yarn install
3424
- name: Compile TypeScript
3525
run: yarn run build
36-
- name: Upload compiled TypeScript
37-
uses: actions/upload-artifact@v1
26+
- name: Upload compiler output
27+
uses: actions/upload-artifact@master
3828
with:
3929
name: tsc_output
40-
path: tsc_output
30+
path: ./tsc_output
4131
lint:
4232
name: Lint
4333

@@ -51,19 +41,9 @@ jobs:
5141
- name: Setup Node.js for use with Actions
5242
uses: actions/setup-node@v1
5343
with:
54-
node-version: '12.14.1'
44+
node-version: '12.16.0'
5545
- name: Install Yarn
5646
run: curl -o- -L https://yarnpkg.com/install.sh | bash
57-
- name: Get yarn cache
58-
id: yarn-cache
59-
run: echo "::set-output name=dir::$(yarn cache dir)"
60-
- name: Cache dependencies
61-
uses: actions/cache@v1
62-
with:
63-
path: ${{ steps.yarn-cache.outputs.dir }}
64-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
65-
restore-keys: |
66-
${{ runner.os }}-yarn-
6747
- name: Install dependencies with Yarn
6848
run: yarn install
6949
- name: Lint with XO
@@ -81,20 +61,37 @@ jobs:
8161
- name: Setup Node.js for use with Actions
8262
uses: actions/setup-node@v1
8363
with:
84-
node-version: '12.14.1'
64+
node-version: '12.16.0'
8565
- name: Install Yarn
8666
run: curl -o- -L https://yarnpkg.com/install.sh | bash
87-
- name: Get yarn cache
88-
id: yarn-cache
89-
run: echo "::set-output name=dir::$(yarn cache dir)"
90-
- name: Cache dependencies
91-
uses: actions/cache@v1
92-
with:
93-
path: ${{ steps.yarn-cache.outputs.dir }}
94-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
95-
restore-keys: |
96-
${{ runner.os }}-yarn-
9767
- name: Install dependencies with Yarn
9868
run: yarn install
9969
- name: Check style with Prettier
10070
run: yarn run style
71+
publish:
72+
name: Publish
73+
74+
runs-on: ubuntu-latest
75+
76+
needs: [lint, style]
77+
78+
steps:
79+
- name: Checkout git repository
80+
uses: actions/checkout@v1
81+
with:
82+
fetch-depth: 0
83+
- name: Setup Node.js for use with Actions
84+
uses: actions/setup-node@v1
85+
with:
86+
node-version: '12.16.0'
87+
- name: Install Yarn
88+
run: curl -o- -L https://yarnpkg.com/install.sh | bash
89+
- name: Install dependencies with Yarn
90+
run: yarn install
91+
- name: Compile TypeScript for publishing
92+
run: yarn run build --build tsconfig.build.json
93+
- name: Run semantic release
94+
run: yarn run semantic-release
95+
env:
96+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
},
2424
"license": "Apache-2.0",
2525
"main": "./tsc_output/src/index.js",
26-
"name": "netlify-cache-nextjs",
26+
"name": "netlify-plugin-cache-nextjs",
2727
"private": true,
2828
"repository": {
2929
"type": "git",
@@ -35,7 +35,7 @@
3535
"prebuild": "rm -rf tsc_output",
3636
"style": "prettier --ignore-path .gitignore --check \"./**/*.{{j,t}{s,sx},flow,{sc,c,le}ss,json,m{d,dx},{y,ya}ml}\""
3737
},
38-
"version": "1.0.0",
38+
"version": "0.0.0-development",
3939
"xo": {
4040
"extends": "xo-typescript",
4141
"extensions": [

0 commit comments

Comments
 (0)