forked from web-std/io
-
Notifications
You must be signed in to change notification settings - Fork 24
chore: Auto-deployment #9
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4b0d2e2
chore: add internal repo management deps
chaance 3ad35c8
chore: fix issues re: manypkg
chaance b3e717e
chore: changeset init
chaance d93c09a
Setup changesets for release
chaance 8ee5f00
create changeset
chaance c8901fa
chore: delete me
chaance 8f9eead
fix syntax error
chaance bb72bf9
Delete .blargh
chaance cc27231
chore: remove temp testing files
chaance dfeb243
rm prettier for now
chaance 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
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.
manypkg
is a nice little helper that just checks all of your packages to check if you have any common monorepo mistakes (ie version incompatibilities). It's pretty sweet and simple andfix
just neatly autofixes anything that it can.