Skip to content

chore: Release 2.5.0 #44

chore: Release 2.5.0

chore: Release 2.5.0 #44

Workflow file for this run

name: Create Release
on:
push:
tags: ["v*"]
permissions:
id-token: write # Required for OIDC
contents: write # Required for action-gh-release
jobs:
build-matrix:
strategy:
matrix:
node-version:
- 20.x
os:
- windows-2022
- ubuntu-22.04
- macos-15
- macos-15-intel
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
if: ${{ startsWith(matrix.os, 'ubuntu') }}
run: sudo apt install -y unixodbc-dev
- name: Install Build Dependencies
if: ${{ startsWith(matrix.os, 'macos') }}
run: brew install unixodbc
- name: Upgrade NPM
run: npm install -g npm
- name: Install node-gyp
run: npm install -g node-gyp
- name: Install npm dependencies
run: npm ci --production
- name: Patch node-pre-gyp on Windows
if: ${{ startsWith(matrix.os, 'windows') }}
# https://github.com/mapbox/node-pre-gyp/issues/715
run: node .github/fix-node-pre-gyp-windows.js
- name: Build Binary
run: ./node_modules/.bin/node-pre-gyp rebuild --production
- name: Package Binary
run: ./node_modules/.bin/node-pre-gyp package
- name: Upload Artifact
uses: actions/upload-artifact@v5
with:
name: binaries-${{ matrix.os }}
path: build/stage/*.tar.gz
create-release:
runs-on: ubuntu-latest
needs: build-matrix
steps:
- uses: actions/checkout@v2
- name: get-npm-version
id: package-version
run: jq -r '"version=" + .version' package.json >> "$GITHUB_OUTPUT"
- name: get-npm-tag
id: package-tag
run: .github/npm-tag.sh $PACKAGE_VERSION >> "$GITHUB_OUTPUT"
env:
PACKAGE_VERSION: ${{ steps.package-version.outputs.version }}
# Download all of the various binaries that were created
- name: Download built binaries from workflow
uses: actions/download-artifact@v5
with:
path: binaries
pattern: binaries-*
merge-multiple: true
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
with:
draft: false
prerelease: false
name: ${{ steps.package-version.outputs.version }}
generate_release_notes: true
fail_on_unmatched_files: true
files:
./binaries/odbc-*.tar.gz
- name: Publish to NPM
uses: actions/setup-node@v4
with:
node-version: '24'
registry-url: 'https://registry.npmjs.org'
- run: npm publish --tag $PACKAGE_TAG
env:
PACKAGE_TAG: ${{ steps.package-tag.outputs.tag }}