Add workflows
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 0000000..2e07484
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,64 @@
+name: Build and Release
+
+on:
+ push:
+ tags:
+ - 'v*'
+ workflow_dispatch:
+
+jobs:
+ test:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: '18'
+ cache: 'npm'
+ - run: npm ci
+ - run: npm test
+
+ build:
+ needs: test
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: '18'
+ cache: 'npm'
+ - run: npm ci
+ - run: mkdir -p bin/linux bin/macos bin/win
+ - name: Build Linux executable
+ run: npm run pkg-linux
+ - name: Build macOS executable
+ run: npm run pkg-macos
+ - name: Build Windows executable
+ run: npm run pkg-win
+ - name: Upload Linux binary
+ uses: actions/upload-artifact@v4
+ with:
+ name: conllu-gender-linux-x64
+ path: bin/linux/conllu-gender
+ if-no-files-found: error
+ - name: Upload macOS binary
+ uses: actions/upload-artifact@v4
+ with:
+ name: conllu-gender-macos-x64
+ path: bin/macos/conllu-gender
+ if-no-files-found: error
+ - name: Upload Windows binary
+ uses: actions/upload-artifact@v4
+ with:
+ name: conllu-gender-win-x64
+ path: bin/win/conllu-gender.exe
+ if-no-files-found: error
+ - name: Create GitHub Release
+ if: startsWith(github.ref, 'refs/tags/')
+ uses: softprops/action-gh-release@v2
+ with:
+ files: |
+ bin/linux/conllu-gender
+ bin/macos/conllu-gender
+ bin/win/conllu-gender.exe
+ generate_release_notes: true
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..b3c802d
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,37 @@
+stages:
+ - test
+ - build
+
+default:
+ image: node:18
+ cache:
+ key:
+ files:
+ - package-lock.json
+ paths:
+ - node_modules/
+
+test:
+ stage: test
+ script:
+ - npm ci
+ - npm test
+
+build:
+ stage: build
+ script:
+ - npm ci
+ - mkdir -p bin/linux bin/macos bin/win
+ - npm run pkg-linux
+ - npm run pkg-macos
+ - npm run pkg-win
+ artifacts:
+ name: "conllu-gender-${CI_COMMIT_TAG:-${CI_COMMIT_SHORT_SHA}}"
+ paths:
+ - bin/linux/conllu-gender
+ - bin/macos/conllu-gender
+ - bin/win/conllu-gender.exe
+ expire_in: 4 weeks
+ rules:
+ - if: $CI_COMMIT_TAG
+ - if: $CI_PIPELINE_SOURCE == "web"