Skip to content

Commit

Permalink
ci: Add GitHub Workflow (#1879)
Browse files Browse the repository at this point in the history
* chore(deps-dev): bump express from 4.17.1 to 4.19.2 (#1891)

Bumps [express](https://github.com/expressjs/express) from 4.17.1 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](expressjs/express@4.17.1...4.19.2)

---
updated-dependencies:
- dependency-name: express
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix: handle no-refs response from git-upload-pack for git > 2.41.0 (#1862)

* ci: Add GitHub Workflow

* Prevent ERR_OSSL_EVP_UNSUPPORTED on Node >= 17

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dan Allen <dan.j.allen@gmail.com>
  • Loading branch information
3 people committed Apr 20, 2024
1 parent d631f8e commit d50cede
Show file tree
Hide file tree
Showing 12 changed files with 787 additions and 459 deletions.
85 changes: 85 additions & 0 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
name: CI/CD

on:
push:
branches:
- main
- beta
pull_request:
workflow_dispatch:
inputs:
node-version:
description: Comma-separated list of Node.js versions
required: true
default: '16, 18, 20'
test-browsers:
description: 'Comma-separated list of browsers'
required: true
default: 'ChromeHeadlessNoSandbox,FirefoxHeadless,sl_edge,sl_safari,sl_ios_safari,bs_android_chrome'

jobs:
build:
name: Node.js v${{ matrix.node-version }}
runs-on: ubuntu-latest

# Most pipelines finish in under 15 minutes.
timeout-minutes: 30

strategy:
fail-fast: false
matrix:
# Use the input, or fallback to the array.
node-version: ${{ fromJSON(format('[{0}]', inputs.node-version || '16, 18, 20')) }}

steps:
- uses: actions/checkout@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm

- name: Install dependencies
run: npm ci

- name: Run tests
run: |
# Use X Virtual Frame Buffer (xvfb) to run headless in CI
xvfb-run --auto-servernum --server-args='-screen 0, 1920x1080x24' npm test
env:
BROWSER_STACK_USERNAME: ${{ secrets.BROWSER_STACK_USERNAME }}
BROWSER_STACK_ACCESS_KEY: ${{ secrets.BROWSER_STACK_ACCESS_KEY }}
BUNDLEWATCH_GITHUB_TOKEN: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
TEST_BROWSERS: ${{ inputs.test-browsers || 'ChromeHeadlessNoSandbox,FirefoxHeadless,sl_edge,sl_safari,sl_ios_safari,bs_android_chrome' }}

- name: Save npm-tarball.tgz
if: always()
uses: actions/upload-artifact@v4
with:
name: 'node-v${{ matrix.node-version }}-npm-tarball.tgz'
path: 'isomorphic-git-0.0.0-development.tgz'

- name: 'Save index.umd.min.js'
if: always()
uses: actions/upload-artifact@v4
with:
name: 'node-v${{ matrix.node-version }}-index.umd.min.js'
path: 'index.umd.min.js'

- name: 'Publish to npm'
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta' }}
run: npm run semantic-release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: 'Update website'
if: ${{ github.ref == 'refs/heads/main' }}
run: npm run publish-website
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v16.20.2
2 changes: 0 additions & 2 deletions .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,3 @@ branches:
prerelease: true
success:
- '@semantic-release/github'
- path: '@semantic-release/exec'
cmd: "node __tests__/__helpers__/tweet.cjs 'v${nextRelease.version} has been published! https://github.com/isomorphic-git/isomorphic-git/releases/tag/v${nextRelease.version}'"
1 change: 1 addition & 0 deletions __tests__/__fixtures__/test-empty.git/description
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a git repository with no refs; the objects and refs folders are required to make it a valid repository
Empty file.
Empty file.
20 changes: 0 additions & 20 deletions __tests__/__helpers__/tweet.cjs

This file was deleted.

28 changes: 14 additions & 14 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,18 @@ jobs:
artifactName: 'index.umd.min.js'
PathtoPublish: '$(System.DefaultWorkingDirectory)/index.umd.min.js'

- script: npm run semantic-release
displayName: 'Publish to npm'
condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), eq(variables['Build.SourceBranch'], 'refs/heads/beta')))
env:
GH_TOKEN: $(GITHUB_TOKEN)
NPM_TOKEN: $(Npm.Token)
TWITTER_ACCESS_TOKEN_SECRET: $(TWITTER_ACCESS_TOKEN_SECRET)
TWITTER_CONSUMER_SECRET: $(TWITTER_CONSUMER_SECRET)
# - script: npm run semantic-release
# displayName: 'Publish to npm'
# condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), eq(variables['Build.SourceBranch'], 'refs/heads/beta')))
# env:
# GH_TOKEN: $(GITHUB_TOKEN)
# NPM_TOKEN: $(Npm.Token)
# TWITTER_ACCESS_TOKEN_SECRET: $(TWITTER_ACCESS_TOKEN_SECRET)
# TWITTER_CONSUMER_SECRET: $(TWITTER_CONSUMER_SECRET)

- script: npm run publish-website
displayName: 'Update website'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
env:
GITHUB_TOKEN: $(GITHUB_TOKEN)
NPM_TOKEN: $(Npm.Token)
# - script: npm run publish-website
# displayName: 'Update website'
# condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
# env:
# GITHUB_TOKEN: $(GITHUB_TOKEN)
# NPM_TOKEN: $(Npm.Token)

0 comments on commit d50cede

Please sign in to comment.