Skip to content

Commit ea2465f

Browse files
ericsciplethboopkonradpabjan
authored
Update and rename deno.yml to rename.yml (actions#721)
* Create process to release packages via actions Co-authored-by: Thomas Boop <52323235+thboop@users.noreply.github.com> Co-authored-by: Konrad Pabjan <konradpabjan@github.com>
1 parent 770dc3a commit ea2465f

2 files changed

Lines changed: 72 additions & 43 deletions

File tree

.github/workflows/deno.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

.github/workflows/releases.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Publish NPM
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
package:
7+
required: true
8+
description: 'core, artifact, cache, exec, github, glob, io, tool-cache'
9+
10+
jobs:
11+
test:
12+
runs-on: macos-latest
13+
14+
steps:
15+
- name: setup repo
16+
uses: actions/checkout@v2
17+
18+
- name: verify package exists
19+
run: ls packages/${{ github.event.inputs.package }}
20+
21+
- name: npm install
22+
run: npm install
23+
24+
- name: bootstrap
25+
run: npm run bootstrap
26+
27+
- name: build
28+
run: npm run build
29+
30+
- name: test
31+
run: npm run test
32+
33+
- name: pack
34+
run: npm pack
35+
working-directory: packages/${{ github.event.inputs.package }}
36+
37+
- name: upload artifact
38+
uses: actions/upload-artifact@v2
39+
with:
40+
name: ${{ github.event.inputs.package }}
41+
path: packages/${{ github.event.inputs.package }}/*.tgz
42+
43+
publish:
44+
runs-on: macos-latest
45+
needs: test
46+
environment: npm-publish
47+
steps:
48+
49+
- name: download artifact
50+
uses: actions/download-artifact@v2
51+
with:
52+
name: ${{ github.event.inputs.package }}
53+
54+
- name: publish
55+
run: npm publish *.tgz --dry-run
56+
env:
57+
NPM_TOKEN: ${{ secrets.TOKEN }}
58+
59+
- name: notify slack on failure
60+
if: failure()
61+
run: |
62+
curl -X POST -H 'Content-type: application/json' --data '{"text":":pb__failed: Failed to publish a new version of ${{ github.event.inputs.package }}"}' $SLACK_WEBHOOK
63+
env:
64+
SLACK_WEBHOOK: ${{ secrets.SLACK }}
65+
66+
- name: notify slack on success
67+
if: success()
68+
run: |
69+
curl -X POST -H 'Content-type: application/json' --data '{"text":":dance: Successfully published a new version of ${{ github.event.inputs.package }}"}' $SLACK_WEBHOOK
70+
env:
71+
SLACK_WEBHOOK: ${{ secrets.SLACK }}
72+

0 commit comments

Comments
 (0)