forked from sorke/Baileys
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (71 loc) · 2.76 KB
/
publish-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Publish Release
on: "workflow_dispatch"
jobs:
# Test:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout Commit
# uses: actions/checkout@v2
#
# - name: Setup Node.js environment
# uses: actions/setup-node@v2.1.1
#
# - name: Install Dependencies
# run: npm install
#
# - name: Run Tests
# run: npm run test
Build:
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout Commit
uses: actions/checkout@v2
- name: Parsing Package Info
id: packageInfo
run: |
echo "::set-output name=package-name::$(jq -r .name package.json)"
echo "::set-output name=package-version::$(jq -r .version package.json)"
echo "::set-output name=commit-msg::$(git log -1 --pretty=%B)"
- name: Setup Node.js environment
uses: actions/setup-node@v2.1.1
- name: Install Dependencies
run: yarn
- name: Build
run: yarn run build:tsc
- name: Create Release
id: releaseCreate
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# The name of the tag. This should come from the webhook payload, `github.GITHUB_REF` when a user pushes a new tag
tag_name: v${{ steps.packageInfo.outputs.package-version }}
# The name of the release. For example, `Release v1.0.1`
release_name: v${{ steps.packageInfo.outputs.package-version }}
# Text describing the contents of the tag.
body: ${{steps.packageInfo.outputs.commit-msg}}
# `true` to create a draft (unpublished) release, `false` to create a published one. Default: `false`
draft: false
# `true` to identify the release as a prerelease. `false` to identify the release as a full release. Default: `false`
prerelease: false
- name: Make Package
run: npm pack
- name: Rename Pack
run: mv *.tgz npmPackage.tgz
- name: Git Release
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# The URL for uploading assets to the release
upload_url: ${{steps.releaseCreate.outputs.upload_url}}
# The path to the asset you want to upload
asset_path: npmPackage.tgz
asset_name: npmPackage.tgz
# The content-type of the asset you want to upload. See the supported Media Types here: https://www.iana.org/assignments/media-types/media-types.xhtml for more information
asset_content_type: application/x-compressed-tar
- name: NPM Publish
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}