forked from web-std/io
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add auto-deployment via Changesets
- Loading branch information
Showing
10 changed files
with
847 additions
and
120 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,8 @@ | ||
# Changesets | ||
|
||
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works | ||
with multi-package repos, or single-package repos to help you version and publish your code. You can | ||
find the full documentation for it [in our repository](https://github.com/changesets/changesets) | ||
|
||
We have a quick list of common questions to get you started engaging with this project in | ||
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) |
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,14 @@ | ||
{ | ||
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json", | ||
"changelog": [ | ||
"@changesets/cli/changelog", | ||
{ "repo": "remix-run/web-std-io" } | ||
], | ||
"commit": false, | ||
"fixed": [], | ||
"linked": [], | ||
"access": "restricted", | ||
"baseBranch": "main", | ||
"updateInternalDependencies": "patch", | ||
"ignore": [] | ||
} |
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 |
---|---|---|
@@ -1,101 +1,46 @@ | ||
name: release | ||
on: | ||
push: | ||
branches: | ||
- main | ||
name: release | ||
concurrency: ${{ github.workflow }}-${{ github.ref }} | ||
env: | ||
CI: true | ||
jobs: | ||
changeFinder: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
nodePaths: ${{ steps.interrogate.outputs.nodePaths }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- id: interrogate | ||
uses: actions/github-script@v4 | ||
with: | ||
github-token: ${{secrets.GITHUB_TOKEN}} | ||
script: | | ||
const {execSync} = require('child_process'); | ||
const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/'); | ||
const latestRelease = await github.repos.getLatestRelease({ | ||
owner, | ||
repo | ||
}); | ||
console.log(`latest release: ${JSON.stringify(latestRelease.data)}`); | ||
execSync('git pull --tags'); | ||
execSync(`git reset --hard ${latestRelease.data.tag_name}`); | ||
const status = execSync(`git diff --name-only origin/main`, { encoding: 'utf-8'}); | ||
console.log(status); | ||
const changes = status.split('\n'); | ||
let nodePaths = new Set(); | ||
for (const change of changes) { | ||
if (change.startsWith('packages/')) { | ||
const [,library] = change.split('/'); | ||
nodePaths.add(library); | ||
}; | ||
} | ||
nodePaths = Array.from(nodePaths); | ||
if(nodePaths.length === 0){ | ||
console.log(`::warning::No changes found, release will be skipped.`) | ||
} | ||
console.log(`::set-output name=nodePaths::${JSON.stringify(nodePaths)}`); | ||
release-pr: | ||
runs-on: ubuntu-latest | ||
needs: changeFinder | ||
if: ${{ fromJson(needs.changeFinder.outputs.nodePaths)[0] != '' }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
package: ${{fromJson(needs.changeFinder.outputs.nodePaths)}} | ||
steps: | ||
- uses: google-github-actions/release-please-action@v2 | ||
id: release-please | ||
with: | ||
path: packages/${{ matrix.package }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
release-type: node | ||
package-name: "@remix-run/web-${{ matrix.package }}" | ||
monorepo-tags: true | ||
changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"refactor","section":"Changes","hidden":false},{"type":"chore","section":"Changes","hidden":false}]' | ||
command: release-pr | ||
release: | ||
name: release | ||
if: ${{ github.repository == 'remix-run/web-std-io' }} | ||
runs-on: ubuntu-latest | ||
needs: changeFinder | ||
if: ${{ fromJson(needs.changeFinder.outputs.nodePaths)[0] != '' }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
package: ${{fromJson(needs.changeFinder.outputs.nodePaths)}} | ||
steps: | ||
- uses: GoogleCloudPlatform/release-please-action@v2 | ||
id: release | ||
with: | ||
path: packages/${{ matrix.package }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
release-type: node | ||
package-name: "@remix-run/web-${{ matrix.package }}" | ||
monorepo-tags: true | ||
changelog-types: '[{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"refactor","section":"Changes","hidden":false},{"type":"chore","section":"Changes","hidden":false}]' | ||
command: github-release | ||
# The logic below handles the npm publication: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
# these if statements ensure that a publication only occurs when | ||
# a new release is created: | ||
if: ${{ steps.release.outputs.release_created }} | ||
- name: Setup | ||
uses: actions/setup-node@v2 | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
registry-url: https://registry.npmjs.org/ | ||
if: ${{ steps.release.outputs.release_created }} | ||
cache: 'yarn' | ||
- name: Install | ||
uses: bahmutov/npm-install@v1 | ||
if: ${{ steps.release.outputs.release_created }} | ||
- name: Publish | ||
if: ${{ steps.release.outputs.release_created }} | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}} | ||
run: yarn install --frozen-lockfile | ||
- name: Auth | ||
run: | | ||
cd packages/${{ matrix.package }} | ||
npm publish --access=public | ||
echo "registry=https://registry.npmjs.org" >> ~/.npmrc | ||
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc | ||
# This action has two responsibilities. The first time the workflow runs | ||
# (initial push to `main`) it will create a new branch and then PR back | ||
# to `main` with the related changes for the new version. After the PR | ||
# is merged, the workflow will run again and this action will publish to | ||
# npm. | ||
- name: PR / Publish | ||
id: changesets | ||
uses: changesets/action@v1 | ||
with: | ||
version: yarn version-bump | ||
commit: "chore: Update version for release" | ||
title: "chore: Update version for release" | ||
publish: yarn release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_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
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 |
---|---|---|
|
@@ -25,15 +25,15 @@ | |
} | ||
}, | ||
"dependencies": { | ||
"web-encoding": "1.1.5", | ||
"@remix-run/web-stream": "^1.0.3" | ||
"@remix-run/web-stream": "^1.0.3", | ||
"web-encoding": "1.1.5" | ||
}, | ||
"author": "Irakli Gozalishvili <[email protected]> (https://gozala.io)", | ||
"repository": "https://github.com/remix-run/web-std-io", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@types/node": "15.0.2", | ||
"@remix-run/web-fetch": "^4.1.1", | ||
"@types/node": "15.0.2", | ||
"git-validate": "2.2.4", | ||
"husky": "^6.0.0", | ||
"lint-staged": "^11.0.0", | ||
|
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
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
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
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.