1
0
Fork 0

Adding upstream version 0.0~git20250409.f7acab6.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-05-22 11:36:18 +02:00
parent b9b5d88025
commit 21b930d007
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
51 changed files with 11229 additions and 0 deletions

View file

@ -0,0 +1,48 @@
name: Publish type definitions to npm
inputs:
VERSION:
description: Packages version
required: true
NODE_AUTH_TOKEN:
description: Node auth token
required: true
runs:
using: composite
steps:
- name: Set variables
id: vars
shell: bash
run: |
echo "PKGS=buffer url" >> "${GITHUB_OUTPUT}"
- name: Set versions
shell: bash
run: |
jq --arg version "${{ inputs.VERSION }}" '.version = $version' global-types/package.json > global-types/tmp.json && mv global-types/tmp.json global-types/package.json
for pkg in ${{ steps.vars.outputs.PKGS }}; do
jq --arg version "${{ inputs.VERSION }}" '.version = $version' $pkg/types/package.json > $pkg/types/tmp.json && mv $pkg/types/tmp.json $pkg/types/package.json
done
- name: Update dependency versions
shell: bash
run: |
for pkg in ${{ steps.vars.outputs.PKGS }}; do
jq --arg version "${{ inputs.VERSION }}" '.dependencies."@dop251/types-goja_nodejs-global" = $version' $pkg/types/package.json > $pkg/types/tmp.json && mv $pkg/types/tmp.json $pkg/types/package.json
done
- name: Setup nodejs
uses: actions/setup-node@v2
with:
node-version: '22'
registry-url: 'https://registry.npmjs.org'
- name: Publish the packages
shell: bash
run: |
cd global-types
npm publish --access=public
cd -
for pkg in ${{ steps.vars.outputs.PKGS }}; do
cd $pkg/types
npm publish --access=public
cd -
done
env:
NODE_AUTH_TOKEN: ${{ inputs.NODE_AUTH_TOKEN }}

79
.github/workflows/main.yml vendored Normal file
View file

@ -0,0 +1,79 @@
on: [push, pull_request]
name: Test
jobs:
test:
strategy:
matrix:
go-version: [1.20.x, 1.x]
os: [ubuntu-latest, windows-latest]
arch: ["", "386"]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v3
- name: Check formatting
run: diff -u <(echo -n) <(gofmt -d .)
if: runner.os != 'Windows'
- name: Run go vet
env:
GOARCH: ${{ matrix.arch }}
run: go vet ./...
- name: Run staticcheck
uses: dominikh/staticcheck-action@v1.3.1
with:
version: "2025.1.1"
install-go: false
cache-key: ${{ matrix.go-version }}
if: ${{ matrix.go-version == '1.x' }}
- name: Run tests
env:
GOARCH: ${{ matrix.arch }}
run: go test -vet=off ./...
test-types:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
npm ci
npm test --workspaces
publish-types-tagged:
name: 'Publish type definitions to npm (tagged)'
needs: [test, test-types]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- name: Extract version
run: |
VERSION=$(echo "${{ github.ref }}" | sed 's|refs/tags/v||')
if [[ "$VERSION" == [0-9].* ]]; then
echo "version=$VERSION" >> $GITHUB_ENV
fi
- uses: './.github/actions/publish-types'
if: env.version != ''
with:
VERSION: ${{ env.version }}
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
publish-types-untagged:
name: 'Publish type definitions to npm (untagged master)'
needs: [ test, test-types ]
runs-on: ubuntu-latest
if: "!startsWith(github.ref, 'refs/tags/v') && github.ref_name == 'master'"
steps:
- uses: actions/checkout@v4
- name: Extract version
run: |
VERSION=0.0.0-$(git log -1 --format=%cd --date=format:%Y%m%d%H%M%S)-$(git rev-parse --short=12 HEAD)
echo "version=$VERSION" >> $GITHUB_ENV
- uses: './.github/actions/publish-types'
with:
VERSION: ${{ env.version }}
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}