-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from DIG-Network/release/v0.0.20
Release/v0.0.20
- Loading branch information
Showing
11 changed files
with
214 additions
and
70 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,48 @@ | ||
name: Auto Tag | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
concurrency: | ||
group: main-release-check | ||
|
||
jobs: | ||
release: | ||
name: release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clean workspace | ||
uses: Chia-Network/actions/clean-workspace@main | ||
|
||
- name: Checkout current branch | ||
uses: actions/checkout@v3 | ||
with: | ||
# Need PACKAGE_ADMIN_PAT token so when the tag is created, the tag automation runs | ||
token: ${{ secrets.GH_ACCESS_TOKEN }} | ||
fetch-depth: 0 | ||
|
||
- name: Set Git identity | ||
run: | | ||
git config --local user.email "automation@michaeltaylor.dev" | ||
git config --local user.name "Automation" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract version from package.json | ||
run: | | ||
VERSION=$(jq -r '.version' package.json) | ||
echo "Extracted version: $VERSION" | ||
# Set the version as an output for other steps to use | ||
echo "VERSION=$VERSION" >> $GITHUB_ENV | ||
if git tag --list | grep -q "^$VERSION$"; then | ||
echo "Tag $VERSION already exists, nothing to do." | ||
else | ||
echo "Tag does not exist. Creating and pushing tag." | ||
git tag $VERSION -m "Release $VERSION" | ||
git push origin $VERSION | ||
fi | ||
shell: bash |
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,52 @@ | ||
name: Build and Publish to npm | ||
|
||
on: | ||
push: | ||
tags: | ||
- "**" | ||
|
||
concurrency: | ||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-and-publish: | ||
name: Build and Publish to npm | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "18.x" | ||
|
||
- name: Install Dependencies | ||
run: npm ci | ||
|
||
- name: Build Project | ||
run: npm run build | ||
|
||
- name: Extract Version and Determine Tag | ||
id: extract-version | ||
run: | | ||
VERSION=$(jq -r '.version' package.json) | ||
if [[ "$VERSION" == *"alpha"* ]]; then | ||
TAG="alpha" | ||
elif [[ "$VERSION" == *"beta"* ]]; then | ||
TAG="beta" | ||
else | ||
TAG="latest" | ||
fi | ||
echo "VERSION=$VERSION" >> $GITHUB_ENV | ||
echo "TAG=$TAG" >> $GITHUB_ENV | ||
- name: Publish to npm | ||
run: | | ||
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc | ||
npm publish --tag ${{ env.TAG }} --access public | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# This workflow runs on any PRs that are targeting main and ensures that the version in package.json is incremented | ||
name: Check Version Increment | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- 'main' | ||
|
||
concurrency: | ||
# SHA is added to the end if on `main` to let all main workflows run | ||
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ github.ref == 'refs/heads/main' && github.sha || '' }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
check-version: | ||
name: Check version increment | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: Chia-Network/actions/clean-workspace@main | ||
|
||
- name: Checkout current branch | ||
uses: actions/checkout@v3 | ||
with: | ||
path: branch-repo | ||
|
||
- name: Checkout main | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: main | ||
path: main-repo | ||
|
||
- name: Check Versions | ||
run: | | ||
# Extract version from main branch's package.json | ||
mainVersion=$(jq -r '.version' main-repo/package.json) | ||
echo "Main version: $mainVersion" | ||
# Extract version from current branch's package.json | ||
branchVersion=$(jq -r '.version' branch-repo/package.json) | ||
echo "Branch version: $branchVersion" | ||
# Compare versions | ||
if [ "$branchVersion" == "$mainVersion" ]; then | ||
echo "Version in package.json on this branch is not incremented. Version must increment for a merge to main." | ||
exit 1 | ||
fi | ||
shell: bash |
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 was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
# Check for uncommitted changes | ||
if ! git diff-index --quiet HEAD --; then | ||
echo "You have uncommitted changes. Please commit or stash them before running this script." | ||
exit 1 | ||
fi | ||
|
||
# Ensure we're on the develop branch | ||
CURRENT_BRANCH=$(git branch --show-current) | ||
if [ "$CURRENT_BRANCH" != "develop" ]; then | ||
echo "You must be on the 'develop' branch to run this script." | ||
exit 1 | ||
fi | ||
|
||
# Run standard-version for version bumping | ||
npx standard-version | ||
|
||
# Extract the new version from package.json after bumping | ||
NEW_VERSION=$(jq -r '.version' package.json) | ||
|
||
# Create a new feature branch based on the new version | ||
FEATURE_BRANCH="release/v$NEW_VERSION" | ||
git checkout -b "$FEATURE_BRANCH" | ||
|
||
# Commit changes | ||
git add . | ||
git commit -m "chore(release): bump version to $NEW_VERSION" | ||
git push --set-upstream origin "$FEATURE_BRANCH" | ||
|
||
# Notify the user about the feature branch | ||
echo "Version bumped and committed on branch $FEATURE_BRANCH." | ||
|
||
git checkout develop | ||
|
||
echo "Release PR set to origin on branch $FEATURE_BRANCH." |
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 @@ | ||
export * from './DataIntegrityTree'; |
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,15 +1,18 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ES2020", | ||
"module": "commonjs", | ||
"strict": true, | ||
"esModuleInterop": true, | ||
"skipLibCheck": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"outDir": "./dist", | ||
"rootDir": "./src" | ||
}, | ||
"include": ["src/**/*.ts", "src/utils.disabled", "tests/integration/test.ts"], | ||
"exclude": ["node_modules", "dist"] | ||
} | ||
|
||
"compilerOptions": { | ||
"target": "ES2020", | ||
"module": "commonjs", | ||
"strict": true, | ||
"esModuleInterop": true, | ||
"skipLibCheck": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"outDir": "./dist", | ||
"rootDir": "./src", | ||
"declaration": true, | ||
"declarationMap": true, | ||
"emitDeclarationOnly": false, | ||
"declarationDir": "./dist" | ||
}, | ||
"include": ["src/**/*.ts"], | ||
"exclude": ["node_modules", "dist"] | ||
} |