Skip to content

Commit

Permalink
chore: use Node.js v16 for all release version of Monika (#968)
Browse files Browse the repository at this point in the history
  • Loading branch information
haricnugraha committed Jan 13, 2023
1 parent 7de7e52 commit c3b00dd
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 61 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docker-release-from-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs:
version:
description: 'Monika NPM version to create docker image'
description: "Monika NPM version to create docker image"
required: true
type: string

Expand All @@ -23,7 +23,7 @@ jobs:
- name: 🔧 Setup Node
uses: actions/setup-node@v1
with:
node-version: 14
node-version: 16

- name: 📥 Install Dependencies
run: npm ci
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/nightly-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ jobs:
- name: 🔧 Setup Node
uses: actions/setup-node@v1
with:
node-version: 14
node-version: 16

- name: 📥 Install Dependencies
run: npm ci

- name: 🧪 Run Unit Tests
run: npm test

Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
- name: 🚀 Publish
if: steps.version.outputs.NEXT_VERSION
run: npm publish --access public --tag nightly

- name: 💬 Notify Teams
if: steps.version.outputs.NEXT_VERSION
uses: joelwmale/webhook-action@fd99bb3b8272237103e349e9bb4d9b0ead9a217c
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
node-version: 16
- run: npm ci
- run: npm test

Expand All @@ -26,7 +26,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
node-version: 16
- run: npm ci
- run: npm pack
- run: npm install -g ./hyperjumptech-monika-*.tgz
Expand All @@ -39,7 +39,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish --access public
Expand All @@ -53,4 +53,3 @@ jobs:
with:
url: ${{secrets.HYPERJUMP_TEAMS_SYMON_WEBHOOK}}
body: '{"title": "Monika NPM Release", "Text": "Version: ${{steps.package-version.outputs.current-version}}"}'

6 changes: 3 additions & 3 deletions .github/workflows/publish-snap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
node-version: 16
- run: npm ci
name: Install dependencies
- run: npm test
Expand All @@ -32,7 +32,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
node-version: 16
- run: npm ci
name: Install dependencies
- run: npm install -g oclif
Expand All @@ -50,4 +50,4 @@ jobs:
with:
store_login: ${{ secrets.STORE_LOGIN }}
snap: ${{ steps.snapcraft.outputs.snap }}
release: edge
release: edge
90 changes: 45 additions & 45 deletions .github/workflows/upload-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
node-version: 16
- run: npm ci
name: Install dependencies
- run: npm test
Expand Down Expand Up @@ -51,8 +51,8 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
node-version: 16

- run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
name: Get version
id: get_version
Expand All @@ -61,22 +61,22 @@ jobs:
- run: npm ci
name: Install dependencies

- run: npm run pkg -- -t node14-${{ matrix.platform }}
- run: npm run pkg -- -t node16-${{ matrix.platform }}
name: Pack the binary using vercel/pkg

- run: file ./dist/*
name: List all the files to be compressed
shell: bash

- name: Compress all binaries to one zip
uses: vimtor/action-zip@v1
with:
files: dist/${{ matrix.file_name }}
dest: monika-${{ steps.get_version.outputs.VERSION }}-${{ matrix.platform }}.zip

- name: Generate SHA256 Checksum
run: shasum -a 256 monika-${{ steps.get_version.outputs.VERSION }}-${{ matrix.platform }}.zip > monika-${{ steps.get_version.outputs.VERSION }}-${{ matrix.platform }}-CHECKSUM.txt

- name: Upload binary to release
id: upload_binary_to_release
uses: svenstaro/upload-release-action@v2
Expand All @@ -93,7 +93,7 @@ jobs:
file: monika-${{ steps.get_version.outputs.VERSION }}-${{ matrix.platform }}-CHECKSUM.txt
asset_name: monika-${{ steps.get_version.outputs.VERSION }}-${{ matrix.platform }}-CHECKSUM.txt
tag: ${{ github.ref }}

- name: Read checksum file
if: runner.os == 'Windows'
id: checksum_file
Expand All @@ -109,24 +109,24 @@ jobs:
if: runner.os == 'Windows'
uses: actions/github-script@v6
with:
script: |
const fs = require('fs');
const oldString = fs.readFileSync('./chocolatey/example/chocolateyinstall.example.ps1','utf8').toString();
const releaseUrlString = "${{ steps.upload_binary_to_release.outputs.browser_download_url }}"
const checkSumString = "${{ steps.checksum_file.outputs.content }}".split("*")[0].trim()
const newString = oldString.replace("_RELEASE_URL_", releaseUrlString).replace("_CHECKSUM_CONTENT_", checkSumString);
fs.writeFile("./chocolatey/tools/chocolateyinstall.ps1", newString, {
encoding: "utf8"
},
(err) => {
if (err)
console.log(err);
else {
console.log("File written successfully\n");
}
});
return newString;
result-encoding: string
script: |
const fs = require('fs');
const oldString = fs.readFileSync('./chocolatey/example/chocolateyinstall.example.ps1','utf8').toString();
const releaseUrlString = "${{ steps.upload_binary_to_release.outputs.browser_download_url }}"
const checkSumString = "${{ steps.checksum_file.outputs.content }}".split("*")[0].trim()
const newString = oldString.replace("_RELEASE_URL_", releaseUrlString).replace("_CHECKSUM_CONTENT_", checkSumString);
fs.writeFile("./chocolatey/tools/chocolateyinstall.ps1", newString, {
encoding: "utf8"
},
(err) => {
if (err)
console.log(err);
else {
console.log("File written successfully\n");
}
});
return newString;
result-encoding: string

- name: See chocolateyinstall.ps1 file content
if: runner.os == 'Windows'
Expand All @@ -147,29 +147,29 @@ jobs:
with:
path: version_number.txt
trim: true

- name: Change version in nuspec file
if: runner.os == 'Windows'
uses: actions/github-script@v6
with:
script: |
const fs = require('fs');
const oldString = fs.readFileSync('./chocolatey/example/monika.example.nuspec','utf8').toString();
const versionString = "${{ steps.read_version.outputs.content }}"
const newString = oldString.replace("_VERSION_", versionString);
fs.writeFile("./chocolatey/monika.nuspec", newString, {
encoding: "utf8"
},
(err) => {
if (err)
console.log(err);
else {
console.log("File written successfully\n");
}
});
return newString;
result-encoding: string
script: |
const fs = require('fs');
const oldString = fs.readFileSync('./chocolatey/example/monika.example.nuspec','utf8').toString();
const versionString = "${{ steps.read_version.outputs.content }}"
const newString = oldString.replace("_VERSION_", versionString);
fs.writeFile("./chocolatey/monika.nuspec", newString, {
encoding: "utf8"
},
(err) => {
if (err)
console.log(err);
else {
console.log("File written successfully\n");
}
});
return newString;
result-encoding: string

- name: see nuspec file content
if: runner.os == 'Windows'
run: cat ./chocolatey/monika.nuspec
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.flyio
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:14-alpine
FROM node:16-alpine

RUN apk add --no-cache --virtual .gyp python3 make g++

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@
"node_modules/sqlite3/lib/binding/**/*"
],
"targets": [
"node14-linux-x64",
"node14-macos-x64",
"node14-win-x64"
"node16-linux-x64",
"node16-macos-x64",
"node16-win-x64"
],
"outputPath": "dist"
},
Expand Down

0 comments on commit c3b00dd

Please sign in to comment.