-
Notifications
You must be signed in to change notification settings - Fork 10
117 lines (105 loc) · 5.25 KB
/
node-js-publish-github-packages.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# This workflow will run tests using node, make artifacts for all supported OSs and finally upload them in a release
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
name: Node.js Package
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
# Build artifacts for each supported OS
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Add Wix to path on Windows
if: matrix.os == 'windows-latest'
run: |
Add-Content $env:GITHUB_PATH "C:\Program Files (x86)\WiX Toolset v3.11\bin"
# https://github.com/electron/forge/issues/2662
# - name: install maker-flatpak dependencies
# if: matrix.os == 'ubuntu-latest'
# run: |
# sudo apt-get install flatpak -y
# sudo apt-get install flatpak-builder -y
# sudo apt-get install elfutils -y
# sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
# sudo flatpak install flathub org.freedesktop.Platform/x86_64/19.08 org.freedesktop.Sdk/x86_64/19.08 org.electronjs.Electron2.BaseApp/x86_64/stable -y
- name: Install node modules
run: npm install # the package lock is windows dependant, so ci can't be used here.
- name: Make packages
run: npm run make
- name: Upload build artifacts
uses: actions/[email protected]
with:
# Artifact name
name: artifact-${{ matrix.os }} # optional, default is artifact
# A file, directory or wildcard pattern that describes what to upload
path: out/make/*
# The desired behavior if no files are found using the provided path.
# Available Options:
#warn: Output a warning but do not fail the action
#error: Fail the action with an error message
#ignore: Do not output any warnings or errors, the action does not fail
#if-no-files-found: # optional, default is warn
# Duration after which artifact will expire in days. 0 means using default retention.
#Minimum 1 day. Maximum 90 days unless changed from the repository settings page.
#retention-days: # optional
publish-to-release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download all artifacts
uses: actions/[email protected]
#with:
# Artifact name
#name: artifact-ubuntu-latest # optional
# Destination path
#path: # optional
# https://github.com/softprops/action-gh-release
- name: Display structure of downloaded files
run: ls -R
- name: GH Release
# You may pin to the exact commit or the version.
# uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
uses: softprops/[email protected]
with:
# Note-worthy description of changes in release
#body: # optional
# Path to load note-worthy description of changes in release from
#body_path: # optional
# Gives the release a custom name. Defaults to tag name
#name: # optional
# Gives a tag name. Defaults to github.GITHUB_REF
#tag_name: # optional
# Creates a draft release. Defaults to false
draft: true # optional
# Identify the release as a prerelease. Defaults to false
#prerelease: # optional
# Newline-delimited list of path globs for asset files to upload
files: | # optional
artifact-windows-latest/zip/win32/x64/*.zip
artifact-windows-latest/wix/x64/*.msi
artifact-ubuntu-latest/zip/linux/x64/*.zip
# Fails if any of the `files` globs match nothing. Defaults to false
#fail_on_unmatched_files: # optional
# Repository to make releases against, in <owner>/<repo> format
#repository: # optional
# Authorized secret GitHub Personal Access Token. Defaults to github.token
#token: # optional, default is ${{ github.token }}
# Commitish value that determines where the Git tag is created from. Can be any branch or commit SHA.
#target_commitish: # optional
# If specified, a discussion of the specified category is created and linked to the release. The value must be a category that already exists in the repository. If there is already a discussion linked to the release, this parameter is ignored.
#discussion_category_name: # optional
# Whether to automatically generate the name and body for this release. If name is specified, the specified name will be used; otherwise, a name will be automatically generated. If body is specified, the body will be pre-pended to the automatically generated notes.
#generate_release_notes: # optional
# Append to existing body instead of overwriting it. Default is false.
#append_body: # optional