-
-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace release scripts with GHA (#563)
- Loading branch information
1 parent
27ae143
commit 7bef031
Showing
7 changed files
with
2,957 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Manual Docker Publish | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
releaseType: | ||
description: 'Release type - major, minor or patch' | ||
required: true | ||
default: 'patch' | ||
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/[email protected] | ||
with: | ||
route: GET /orgs/:organisation/teams/:team/memberships/${{ github.actor }} | ||
team: technical-steering-committee | ||
organisation: webdriverio | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
release: | ||
needs: [authorize] | ||
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: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
# list of Docker images to use as base name for tags | ||
images: | | ||
vvoyer/selenium-standalone | ||
# generate Docker tags based on the following events/attributes | ||
tags: | | ||
type=schedule | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=semver,pattern={{major}} | ||
type=sha | ||
- 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: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Manual NPM Publish | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
releaseType: | ||
description: 'Release type - major, minor or patch' | ||
required: true | ||
default: 'patch' | ||
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/[email protected] | ||
with: | ||
route: GET /orgs/:organisation/teams/:team/memberships/${{ github.actor }} | ||
team: technical-steering-committee | ||
organisation: webdriverio | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_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: 14.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 "[email protected]" | ||
git config --global user.name "WebdriverIO Release Bot" | ||
- name: Install Dependencies | ||
run: yarn install | ||
- name: Release | ||
run: npm run release:ci -- ${{github.event.inputs.releaseType}} | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.