Skip to content

Commit

Permalink
Merge pull request #4 from DIG-Network/release/v0.0.1-alpha.5
Browse files Browse the repository at this point in the history
Release/v0.0.1 alpha.5
  • Loading branch information
MichaelTaylor3D authored Sep 9, 2024
2 parents f154acd + 15accf7 commit 1f60235
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 32 deletions.
57 changes: 28 additions & 29 deletions .github/workflows/ensure-version-increment.yaml
Original file line number Diff line number Diff line change
@@ -1,48 +1,47 @@
name: Auto Tag
# 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:
push:
pull_request:
branches:
- main
- 'main'

concurrency:
group: main-release-check
# 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:
release:
name: release
check-version:
name: Check version increment
runs-on: ubuntu-latest
steps:
- name: Clean workspace
uses: Chia-Network/actions/clean-workspace@main
- 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
path: branch-repo

- name: Set Git identity
run: |
git config --local user.email "[email protected]"
git config --local user.name "Automation"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout main
uses: actions/checkout@v3
with:
ref: main
path: main-repo

- name: Extract version from package.json
- name: Check Versions
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
# Extract version from main branch's package.json
mainVersion=$(jq -r '.version' main-repo/package.json)
echo "Main version: $mainVersion"
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
# 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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [0.0.1-alpha.5](https://github.com/DIG-Network/dig-content-server/compare/v0.0.1-alpha.4...v0.0.1-alpha.5) (2024-09-09)

### [0.0.1-alpha.4](https://github.com/DIG-Network/dig-content-server/compare/v0.0.1-alpha.3...v0.0.1-alpha.4) (2024-09-09)

### [0.0.1-alpha.3](https://github.com/DIG-Network/dig-content-server/compare/v0.0.1...v0.0.1-alpha.3) (2024-09-09)
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dig-cli",
"version": "0.0.1-alpha.4",
"version": "0.0.1-alpha.5",
"description": "",
"type": "commonjs",
"main": "./dist/index.js",
Expand Down
1 change: 1 addition & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ 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."
Expand Down

0 comments on commit 1f60235

Please sign in to comment.