-
Notifications
You must be signed in to change notification settings - Fork 54
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
chore: update release ci and add github-release #147
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -3,62 +3,72 @@ name: ci | |
on: [push, pull_request] | ||
|
||
jobs: | ||
should-skip: | ||
continue-on-error: true | ||
runs-on: ubuntu-latest | ||
# Map a step output to a job output | ||
outputs: | ||
should-skip-job: ${{steps.skip-check.outputs.should_skip}} | ||
steps: | ||
- id: skip-check | ||
uses: fkirc/[email protected] | ||
with: | ||
github_token: ${{github.token}} | ||
|
||
ci: | ||
env: | ||
BROWSER_STACK_USERNAME: ${{ secrets.BROWSER_STACK_USERNAME }} | ||
BROWSER_STACK_ACCESS_KEY: ${{ secrets.BROWSER_STACK_ACCESS_KEY }} | ||
runs-on: ${{ matrix.os }} | ||
needs: should-skip | ||
if: ${{needs.should-skip.outputs.should-skip-job != 'true' || github.ref == 'refs/heads/main'}} | ||
strategy: | ||
# TODO: test IE 11, Legacy Edge, and New Edge on windows-latest | ||
# test Safari on macos-latest | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
|
||
test-type: ['unit', 'coverage'] | ||
env: | ||
BROWSER_STACK_USERNAME: ${{secrets.BROWSER_STACK_USERNAME}} | ||
BROWSER_STACK_ACCESS_KEY: ${{secrets.BROWSER_STACK_ACCESS_KEY}} | ||
CI_TEST_TYPE: ${{matrix.test-type}} | ||
runs-on: ${{matrix.os}} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Cache dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.npm | ||
**/node_modules | ||
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-npm- | ||
${{ runner.os }}- | ||
- name: checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Read .nvmrc | ||
- name: read node version from .nvmrc | ||
run: echo ::set-output name=NVMRC::$(cat .nvmrc) | ||
shell: bash | ||
id: nvm | ||
|
||
- name: Install ffmpeg/pulseaudio for firefox on linux w/o browserstack | ||
- name: update apt cache on linux w/o browserstack | ||
run: sudo apt-get update | ||
|
||
- name: install ffmpeg/pulseaudio for firefox on linux w/o browserstack | ||
run: sudo apt-get install ffmpeg pulseaudio | ||
if: ${{ startsWith(matrix.os, 'ubuntu') && !env.BROWSER_STACK_USERNAME }} | ||
|
||
- name: start pulseaudio for firefox on linux w/o browserstack | ||
run: pulseaudio -D | ||
if: ${{ startsWith(matrix.os, 'ubuntu') && !env.BROWSER_STACK_USERNAME }} | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v1 | ||
- name: setup node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '${{ steps.nvm.outputs.NVMRC }}' | ||
- run: npm i --prefer-offline --no-audit | ||
node-version: '${{steps.nvm.outputs.NVMRC}}' | ||
cache: npm | ||
|
||
# run safari on macos | ||
- name: Run Mac test | ||
run: npm run test -- --browsers Safari | ||
if: ${{ startsWith(matrix.os, 'macos') }} | ||
# turn off the default setup-node problem watchers... | ||
- run: echo "::remove-matcher owner=eslint-compact::" | ||
- run: echo "::remove-matcher owner=eslint-stylish::" | ||
- run: echo "::remove-matcher owner=tsc::" | ||
|
||
# only run ie 11 on windows | ||
- name: Run Windows test | ||
run: npm run test -- --browsers IE | ||
if: ${{ startsWith(matrix.os, 'windows') }} | ||
- name: npm install | ||
run: npm i --prefer-offline --no-audit | ||
|
||
# run chrome/firefox or browserstack in linux | ||
- name: Run linux test | ||
- name: run npm test | ||
uses: GabrielBB/xvfb-action@v1 | ||
with: | ||
run: npm test | ||
if: ${{ startsWith(matrix.os, 'ubuntu') }} | ||
run: npm run test | ||
|
||
- name: coverage | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
token: ${{secrets.CODECOV_TOKEN}} | ||
files: './test/dist/coverage/coverage-final.json' | ||
fail_ci_if_error: true | ||
if: ${{startsWith(env.CI_TEST_TYPE, 'coverage')}} |
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,70 @@ | ||
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: | ||
# Set this if you want a netlify example | ||
NETLIFY_BASE: '' | ||
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 || npm run build --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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems like this is something we want to keep?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want the os --browsers thing no. Old version of the ci script operated under the assumption that we would forgo browserstack at some point. Eventually we decided that we can make that jump later and removed all the code for os specific browser runs.