Skip to content

Manual NPM Publish

Manual NPM Publish #42

Workflow file for this run

name: Manual NPM Publish
on:
workflow_dispatch:
inputs:
releaseType:
description: "Release Type"
required: true
type: choice
default: "patch"
options:
- patch
- minor
- major
distTag:
description: 'NPM tag (e.g. use "next" to release a test version)'
required: true
default: 'latest'
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
jobs:
authorize:
runs-on: ubuntu-latest
steps:
- uses: octokit/request-action@v2.0.0
with:
route: GET /orgs/:organisation/teams/:team/memberships/${{ github.actor }}
team: technical-steering-committee
organisation: webdriverio
env:
GITHUB_TOKEN: ${{ secrets.WDIO_BOT_GITHUB_TOKEN }}
npm-release:
needs: [authorize]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: 'main'
fetch-depth: 0
- uses: actions/setup-node@v1
with:
node-version: 16.x
- name: NPM Setup
run: |
npm set registry "https://registry.npmjs.org/"
npm set //registry.npmjs.org/:_authToken $NPM_TOKEN
npm whoami
- name: Git Setup
run: |
git config --global user.email "bot@webdriver.io"
git config --global user.name "WebdriverIO Release Bot"
- name: Install Dependencies
run: npm install
- name: Release
run: npm run release:ci -- ${{github.event.inputs.releaseType}}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
docker-release:
needs: [npm-release]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: 'main'
fetch-depth: 0
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Retrieve version
run: |
echo "TAG_NAME=$(node -e 'console.log(require(`./package.json`).version)')" >> $GITHUB_OUTPUT
id: version
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
# always push given this workflow is triggered manually
push: true
tags: webdriverio/selenium-standalone:v${{ steps.version.outputs.TAG_NAME }}, webdriverio/selenium-standalone:latest