Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

release v2

release v2 #1

Workflow file for this run

name: release v2
on:
push:
branches:
- main
# Trigger release manually
workflow_dispatch:
jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- name: Ensure v2.x exists
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
export SHA=$( gh api \
/repos/$GITHUB_REPOSITORY/git/refs/heads/main \
| jq --raw-output '.object.sha' )
gh api /repos/$GITHUB_REPOSITORY/git/refs \
--field sha="$SHA" \
--field ref="refs/heads/v2.x"
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- run: npm ci
- run: npm run build
- uses: ./
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
dist/index.js
commit-message: Add dist/index.js
ref: refs/heads/v2.x
- uses: actions/upload-artifact@v2
with:
name: build
path: dist/index.js