Browse Source

chore: add a github-release action to automate github releases on version tags (#1182)

pull/1190/head
Brandon Casey 4 years ago
committed by GitHub
parent
commit
e8230a9b22
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 69
      .github/workflows/github-release.yml
  2. 849
      package-lock.json
  3. 5
      package.json

69
.github/workflows/github-release.yml

@ -0,0 +1,69 @@
name: github-release
on:
push:
tags:
# match semver versions
- "v[0-9]+.[0-9]+.[0-9]+"
# match semver pre-releases
- "v[0-9]+.[0-9]+.[0-9]+-*"
jobs:
github-release:
env:
NETLIFY_BASE: 'videojs-http-streaming.netlify.app'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
# We neeed to fetch the entire history as conventional-changelog needs
# access to any number of git commits to build the changelog.
with:
fetch-depth: 0
- name: read node version from .nvmrc
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
shell: bash
id: nvm
- name: setup node
uses: actions/setup-node@v2
with:
node-version: '${{steps.nvm.outputs.NVMRC}}'
cache: npm
- name: npm install
run: npm i --prefer-offline --no-audit
- name: build
run: npm run build-prod --if-present
- name: Check if this is a pre-release
run: echo ::set-output name=IS_PRE_RELEASE::$(npx -p not-prerelease is-prerelease && echo "true" || echo "false")
id: pre-release-check
- name: truncate CHANGELOG.md so that we can get the current versions changes only
run: truncate -s 0 CHANGELOG.md
- name: Generate current release changelog
run: npx -p @videojs/update-changelog vjs-update-changelog --run-on-prerelease
- name: get dashed package version for netlify
run: echo ::set-output name=VERSION::$(node -e "process.stdout.write(require('./package.json').version.split('.').join('-'))")
id: get-version
shell: bash
if: env.NETLIFY_BASE != ''
- name: add netlify preview to release notes
run: |
echo "" >> CHANGELOG.md
echo "[netlify preview for this version](https://v${{steps.get-version.outputs.VERSION}}--${{env.NETLIFY_BASE}})" >> CHANGELOG.md
if: env.NETLIFY_BASE != ''
- name: Create Github release
uses: softprops/action-gh-release@v1
with:
body_path: CHANGELOG.md
token: ${{github.token}}
prerelease: ${{steps.pre-release-check.outputs.IS_PRE_RELEASE}}
files: |
dist/**/*.js
dist/**/*.css

849
package-lock.json
File diff suppressed because it is too large
View File

5
package.json

@ -26,8 +26,7 @@
"server": "karma start scripts/karma.conf.js --singleRun=false --auto-watch",
"test": "npm-run-all lint build-test && karma start scripts/karma.conf.js",
"posttest": "[ \"$CI_TEST_TYPE\" != 'coverage' ] || shx cat test/dist/coverage/text.txt",
"version": "is-prerelease || npm run update-changelog && git add CHANGELOG.md",
"update-changelog": "conventional-changelog -p videojs -i CHANGELOG.md -s",
"version": "vjs-update-changelog --add --run-on-prerelease",
"watch": "npm-run-all -p watch:*",
"watch:js": "npm run build:js -- -w"
},
@ -71,7 +70,7 @@
"devDependencies": {
"@rollup/plugin-replace": "^2.3.4",
"@rollup/plugin-strip": "^2.0.1",
"@videojs/generator-helpers": "~2.0.1",
"@videojs/generator-helpers": "~3.1.0",
"bootstrap": "^5.1.0",
"d3": "^3.4.8",
"es5-shim": "^4.5.13",

Loading…
Cancel
Save