-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (91 loc) · 2.79 KB
/
publish.yml
File metadata and controls
101 lines (91 loc) · 2.79 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
# This generates a zip file of the contents
name: Publish
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
- run: npm ci
- run: npm test
# - name: Zip
# run: zip -9qry "release.zip" "./" -x node_modules/*
# - name: Upload release.zip
# uses: actions/upload-artifact@v2
# with:
# name: release.zip
# path: release.zip
# release:
# needs: build
# name: Create GitHub Release
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@master
# - name: Download release.zip
# uses: actions/download-artifact@v2
# with:
# name: release.zip
# - name: Create Release
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ github.ref }}
# release_name: Release ${{ github.ref }}
# - name: Upload Release Asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./release.zip
# asset_name: release.zip
# asset_content_type: application/zip
publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 17
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
publish-gpr:
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
registry-url: 'https://npm.pkg.github.com'
scope: '@johnakerman'
- name: Update Package Name
run: |
sed -i 's,"name": "gitoutofhours","name": "@johnakerman/gitoutofhours",' package.json
cat package.json
# - name: Update Publish Config
# run: |
# sed -i 's^registry-url^npm.pkg.github.com/@johnakerman^' package.json
# cat package.json
- run: npm ci
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}