Skip to content

ph-municipalities_v1.0.11 #16

ph-municipalities_v1.0.11

ph-municipalities_v1.0.11 #16

Workflow file for this run

name: Package Windows Binaries
# This workflow will trigger on any tag/release created on *any* branch
# Make sure to create tags/releases only from the "master" branch for consistency
on:
release:
types: [published]
jobs:
build-on-win:
name: Lint and Package App
runs-on: windows-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3
- name: Use NodeJS v16.14.2
uses: actions/setup-node@v3
with:
node-version: 16.14.2
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.npm
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: npm-
- name: Install Dependencies and lint
run: |
npm install
git rm .eslintrc.js
# Quick hack to fix unix to windows linebreak-style lint errors
git mv .eslintrc_win.js .eslintrc.js
npm run lint
- name: Packge and archive the executable files
run: |
cp .env.example .env
npm run build:win:all
cd dist
dir
- name: Archive Development Artifact
uses: actions/upload-artifact@v3
with:
name: dist
path: |
dist/ph-regions-win.exe
dist/ph-provinces-win.exe
retention-days: 1
release:
name: Release Built Binary
needs: build-on-win
runs-on: ubuntu-latest
steps:
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: dist
- name: Prepare App
run: |
mv ph-provinces-win.exe ph-provinces-win_${{github.ref_name}}.exe
mv ph-regions-win.exe ph-regions-win_${{github.ref_name}}.exe
tar cvfz ph-regions-win_${{github.ref_name}}.tar.gz ph-regions-win_${{github.ref_name}}.exe
tar cvfz ph-provinces-win_${{github.ref_name}}.tar.gz ph-provinces-win_${{github.ref_name}}.exe
ls -l -a
- name: Attach Artifact to Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
ph-regions-win_${{github.ref_name}}.tar.gz
ph-provinces-win_${{github.ref_name}}.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-npm:
name: Publish to NPM registry
runs-on: ubuntu-latest
needs: build-on-win
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}