-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR adds a workflow to build and publish the package. The package is published as a tgz file in build artifacts and releases. Installation workflow from build artifact: 1. Download the build artifact, extract to see the .tgz file 2. `npm i -g <path_to_file.tgz>` 3. `watcloud-emails -h` Installation workflow from releases: 1. Download the tgz file from a release 2. `npm i -g <path_to_file.tgz>` 3. `watcloud-emails -h`
- Loading branch information
Showing
4 changed files
with
58 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Build and Publish | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
build-and-publish: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
# write is required to write to releases | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 | ||
with: | ||
node-version: '20.x' | ||
- name: Install Dependencies | ||
run: npm ci | ||
- name: Build | ||
run: npm run build | ||
- name: Create Package | ||
run: | | ||
if npm version --no-git-tag-version from-git > /dev/null 2>&1; then | ||
echo "Using auto version based on git tag" | ||
else | ||
echo "Using version 0.0.0-dev" | ||
npm version --no-git-tag-version 0.0.0-dev | ||
fi | ||
mkdir out | ||
npm pack --pack-destination out | ||
- name: Upload build artifact | ||
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 | ||
with: | ||
name: package | ||
path: out/ | ||
- name: Attach build artifact to release | ||
if: github.event_name == 'release' | ||
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # 2.0.8 | ||
with: | ||
files: out/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters