Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cd: add release pipeline #16

Merged
merged 3 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Release

on:
workflow_dispatch:
inputs:
releaseType:
description: "Release type - major, minor or patch"
required: true
default: ""
preReleaseFlavor:
description: "Pre-Release flavor - rc, alpha, beta etc."
required: false
default: ""

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "npm"

- name: Install Dependencies
run: npm ci

- name: Setup Git
run: |
git config --global user.name "devx-sauce-bot"
git config --global user.email "devx.bot@saucelabs.com"

- name: Login to NPM
run: npm set "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}"

- name: Release
if: ${{ github.event.inputs.releaseType != '' }}
run: |
if [ -n "${{ github.event.inputs.preReleaseFlavor }}" ];then
PRE_RELEASE_ARGS="--preRelease=${{ github.event.inputs.preReleaseFlavor }} --github.preRelease"
fi

npm run release:ci -- ${{ github.event.inputs.releaseType }} ${PRE_RELEASE_ARGS}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 0 additions & 6 deletions .release-it.json

This file was deleted.

7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@
"lint": "prettier --check '**/*.{js,ts,mjs,cjs}' && eslint .",
"fmt": "prettier --write '**/*.{js,ts,mjs,cjs}'",
"prepare": "husky",
"test": "mocha tests/unit/"
"test": "mocha tests/unit/",
"release": "release-it --github.release",
"release:ci": "npm run release -- --ci --no-git.requireCleanWorkingDir",
"release:patch": "npm run release -- patch",
"release:minor": "npm run release -- minor",
"release:major": "npm run release -- major"
},
"keywords": [
"testcafe",
Expand Down