Skip to content

Commit

Permalink
feat!: update publishing logic (#374)
Browse files Browse the repository at this point in the history
* Add changeset to workspace

* Changeset init

* Update config

* Check PRs for changeset

* Simplify workflow draft

* Update changeset configs

* Fix comma issue

* Fix yaml

* Fix lock file

* add prefix

* add origin

* split into two jobs

* Adjust readme docs for contributing

* Delete unused

* Use other changelog generator

* Cleanup unused dependencies

* Add comment

* Add math to list

* Add to ignore list

* Can't ignore due to changesets error

* add changeset
  • Loading branch information
Cameron Manavian committed Jul 12, 2022
1 parent 3bed0aa commit 0dd4870
Show file tree
Hide file tree
Showing 19 changed files with 750 additions and 541 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
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)
16 changes: 16 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.0.0/schema.json",
"changelog": [
"@changesets/changelog-github",
{
"repo": "FuelLabs/fuels-ts"
}
],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": []
}
30 changes: 30 additions & 0 deletions .changeset/eight-spies-stare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
"@fuel-ts/abi-coder": patch
"@fuel-ts/constants": patch
"@fuel-ts/contract": patch
"@fuel-ts/example-contract": patch
"forc-bin": patch
"fuels": patch
"@fuel-ts/hasher": patch
"@fuel-ts/hdwallet": patch
"@fuel-ts/interfaces": patch
"@fuel-ts/keystore": patch
"@fuel-ts/math": patch
"@fuel-ts/merkle": patch
"@fuel-ts/merkle-shared": patch
"@fuel-ts/merklesum": patch
"@fuel-ts/mnemonic": patch
"@fuel-ts/predicate": patch
"@fuel-ts/providers": patch
"@fuel-ts/script": patch
"@fuel-ts/signer": patch
"@fuel-ts/sparsemerkle": patch
"@fuel-ts/testcases": patch
"@fuel-ts/transactions": patch
"typechain-target-fuels": patch
"@fuel-ts/wallet": patch
"@fuel-ts/wallet-manager": patch
"@fuel-ts/wordlists": patch
---

Add readme
31 changes: 0 additions & 31 deletions .chglog/CHANGELOG.tpl.md

This file was deleted.

29 changes: 0 additions & 29 deletions .chglog/config.yml

This file was deleted.

14 changes: 14 additions & 0 deletions .github/workflows/pr-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,17 @@ jobs:
- uses: amannn/action-semantic-pull-request@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
validate-changeset:
name: Validate PR Changeset
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: CI Setup
uses: ./.github/actions/ci-setup

- name: Validate Changeset
run: pnpm changeset status --since=origin/master
55 changes: 0 additions & 55 deletions .github/workflows/publish-npm-master.yaml

This file was deleted.

54 changes: 54 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: "Release"

on:
push:
branches:
- master

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: "Release"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: CI Setup
uses: ./.github/actions/ci-setup

- name: Bump Version
run: |
pnpm changeset version
# all workspace packages` package.json will be bumped with pervious step if there are changesets present
- name: Collect Bumped Version
run: |
echo "BUILD_VERSION=$(sed -nE 's/^\s*"version": "(.*?)",$/\1/p' packages/fuels/package.json)" >> $GITHUB_ENV
- name: Build
run: pnpm build

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: pnpm release
commit: "ci(changesets): versioning packages"
title: "ci(changesets): versioning packages"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Release to @next tag on npm
if: steps.changesets.outputs.published != 'true'
run: |
git checkout master
pnpm changeset version --snapshot next
pnpm changeset publish --tag next
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
46 changes: 46 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,52 @@ This will run `services:run`, `test` and then `services:clean`
> maybe you need to run `services:clean` after tests to clean docker containers and volumes. Because
> this can break your tests sometimes!
### Commit Convention

Before you create a Pull Request, please check whether your commits comply with
the commit conventions used in this repository.

When you create a commit we kindly ask you to follow the convention
`category(scope or module): message` in your commit message while using one of
the following categories:

- `feat / feature`: all changes that introduce completely new code or new
features
- `fix`: changes that fix a bug (ideally you will additionally reference an
issue if present)
- `refactor`: any code related change that is not a fix nor a feature
- `docs`: changing existing or creating new documentation (i.e. README, docs for
usage of a lib or cli usage)
- `build`: all changes regarding the build of the software, changes to
dependencies or the addition of new dependencies
- `test`: all changes regarding tests (adding new tests or changing existing
ones)
- `ci`: all changes regarding the configuration of continuous integration (i.e.
github actions, ci system)
- `chore`: all changes to the repository that do not fit into any of the above
categories

### Steps to PR

1. Fork the fuels-ts repository and clone your fork

2. Create a new branch out of the `master` branch.

3. Make and commit your changes following the
[commit convention](https://github.com/FuelLabs/fuels-ts/blob/master/README.md#commit-convention).
As you develop, you can run `pnpm build` and
`pnpm test` to make sure everything works as expected.

4. Run `pnpm changeset` to create a detailed description of your changes. This
will be used to generate a changelog when we publish an update.
[Learn more about Changeset](https://github.com/changesets/changesets/tree/main/packages/cli).
Please note that you might have to run `git fetch origin master` (where
origin will be your fork on GitHub) before `pnpm changeset` works.

> If you made minor changes like CI config, prettier, etc, you can run
> `pnpm changeset add --empty` to generate an empty changeset file to document
> your changes.
## Build and watch all packages

If you want to work locally using realtime builds, open in one terminal tab build in watch mode
Expand Down
20 changes: 5 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
"prettier:format": "prettier --write packages",
"services:run": "make services-run",
"services:clean": "make services-clean",
"release:stable": "ts-node ./scripts/release-stable",
"release:pre": "ts-node ./scripts/release-pre",
"release": "changeset publish",
"forc:update": "ts-node ./scripts/forc-update",
"docs": "typedoc"
},
Expand All @@ -42,22 +41,18 @@
},
"homepage": "https://github.com/FuelLabs/fuels-ts#readme",
"devDependencies": {
"@changesets/changelog-github": "^0.4.5",
"@changesets/cli": "^2.23.0",
"@ethersproject/bytes": "^5.6.1",
"@jest/types": "28.1.0",
"@types/conventional-recommended-bump": "^6.1.0",
"@types/fs-extra": "^9.0.13",
"@types/jest": "27.5.1",
"@types/node": "^14",
"@types/node-fetch": "2",
"@types/prompts": "^2.0.14",
"@types/semver": "^7.3.9",
"@types/shelljs": "^0.8.11",
"@types/web": "^0.0.65",
"@types/yargs": "^17.0.10",
"@typescript-eslint/eslint-plugin": "^5.6.0",
"@typescript-eslint/parser": "^5.6.0",
"conventional-changelog-angular": "^5.0.13",
"conventional-recommended-bump": "^6.1.0",
"dotenv": "^9.0.2",
"eslint": "^8.4.1",
"eslint-config-airbnb-base": "^15.0.0",
Expand All @@ -73,17 +68,13 @@
"eslint-plugin-tsdoc": "^0.2.14",
"ethers": "^5.6.5",
"forc-bin": "workspace:*",
"fs-extra": "^10.1.0",
"jest": "28.1.0",
"markdownlint": "^0.23.1",
"markdownlint-cli": "^0.27.1",
"node-fetch": "2",
"npm-run-all": "^4.1.5",
"open": "^8.4.0",
"ora": "5.4.1",
"prettier": "^2.5.1",
"prompts": "^2.4.2",
"semver": "^7.3.7",
"shelljs": "^0.8.5",
"ts-generator": "^0.1.1",
"ts-jest": "28.0.2",
Expand All @@ -96,7 +87,6 @@
"typedoc-monorepo-link-types": "^0.0.2",
"typedoc-plugin-markdown": "^3.11.12",
"typedoc-plugin-sourcefile-url": "^1.0.6",
"typescript": "^4.5.2",
"yargs": "^17.4.1"
"typescript": "^4.5.2"
}
}
}
Loading

0 comments on commit 0dd4870

Please sign in to comment.