Skip to content

Commit 591fe30

Browse files
authored
Merge pull request #330 from algorandfoundation/chore/version-bump-for-council-deploy
fix: semver + council canary versioning
2 parents eb5ba3d + 6c4c8b5 commit 591fe30

File tree

2 files changed

+38
-15
lines changed

2 files changed

+38
-15
lines changed

.github/workflows/xgov-council-release.yml

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,35 +55,60 @@ jobs:
5555
- name: Extract version from pyproject.toml
5656
id: extract-version
5757
run: |
58-
VERSION=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')
59-
echo "Extracted version from pyproject.toml: $VERSION"
60-
echo "version=$VERSION" >> $GITHUB_OUTPUT
61-
echo "tag=council-v$VERSION" >> $GITHUB_OUTPUT
58+
BASE_VERSION=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')
59+
echo "version=$BASE_VERSION" >> $GITHUB_OUTPUT
60+
61+
- name: Get next canary number for testnet
62+
id: canary-number
63+
if: inputs.environment == 'testnet'
64+
run: |
65+
BASE_VERSION="${{ steps.extract-version.outputs.version }}"
66+
CANARY_TAGS=$(git tag -l "council-v${BASE_VERSION}.canary.*" | sort -V)
67+
if [ -z "$CANARY_TAGS" ]; then
68+
CANARY_NUM=1
69+
else
70+
LATEST_CANARY=$(echo "$CANARY_TAGS" | tail -1)
71+
CANARY_NUM=$(echo "$LATEST_CANARY" | sed "s/council-v${BASE_VERSION}\.canary\.\([0-9]*\)/\1/")
72+
CANARY_NUM=$((CANARY_NUM + 1))
73+
fi
74+
echo "number=$CANARY_NUM" >> $GITHUB_OUTPUT
75+
76+
- name: Set release tag
77+
id: set-tag
78+
run: |
79+
BASE_VERSION="${{ steps.extract-version.outputs.version }}"
80+
if [ "${{ inputs.environment }}" == "testnet" ]; then
81+
TAG="council-v${BASE_VERSION}.canary.${{ steps.canary-number.outputs.number }}"
82+
else
83+
TAG="council-v${BASE_VERSION}-${{ inputs.environment }}"
84+
fi
85+
echo "tag=$TAG" >> $GITHUB_OUTPUT
86+
echo "tag=$TAG" >> $GITHUB_ENV
6287
6388
- name: Create council release tag
6489
run: |
65-
git tag -a "${{ steps.extract-version.outputs.tag }}" -m "Council Release ${{ steps.extract-version.outputs.version }}"
66-
git push origin "${{ steps.extract-version.outputs.tag }}"
90+
TAG="${{ steps.set-tag.outputs.tag }}"
91+
git tag -a "$TAG" -m "Council Release $TAG"
92+
git push origin "$TAG"
6793
6894
- name: Create GitHub council release
6995
uses: softprops/action-gh-release@v2
7096
with:
7197
token: ${{ steps.app-token.outputs.token }}
72-
tag_name: ${{ steps.extract-version.outputs.tag }}
73-
name: Council Release ${{ steps.extract-version.outputs.version }}
98+
tag_name: ${{ steps.set-tag.outputs.tag }}
99+
name: Council Release ${{ steps.set-tag.outputs.tag }}
74100
body: |
75-
🚀 **Council Contract Release ${{ steps.extract-version.outputs.version }}**
101+
🚀 **Council Contract Release ${{ steps.set-tag.outputs.tag }}**
76102
77-
This is a manual release of the Council contract.
103+
This ${{ inputs.environment == 'testnet' && 'canary' || '' }} release has been manually deployed to Algorand ${{ inputs.environment == 'testnet' && 'Testnet' || 'Mainnet' }}
78104
79105
## Deployment
80-
- **Environment**: ${{ inputs.environment }}
81106
- **Registry App ID**: ${{ inputs.registry_app_id || 'from environment variable' }}
82107
83108
## Changes
84109
This release includes the latest Council contract updates.
85110
86-
**✅ Note**: This release was manually triggered and deployed to ${{ inputs.environment }}.
111+
${{ inputs.environment == 'testnet' && '**⚠️ Note**: This is a canary release for testing purposes. Not suitable for production use.' || '' }}
87112
draft: false
88113
prerelease: ${{ inputs.environment == 'testnet' }}
89114

@@ -101,8 +126,6 @@ jobs:
101126
- name: Deploy council to ${{ inputs.environment }}
102127
run: algokit project deploy ${{ inputs.environment }} council
103128
env:
104-
# Council-specific deployment configuration
105-
COUNCIL_DEPLOY_COMMAND: deploy
106129
# Registry app ID - use input if provided, otherwise fall back to environment variable
107130
XGOV_REGISTRY_APP_ID: ${{ inputs.registry_app_id || (inputs.environment == 'mainnet' && vars.XGOV_REGISTRY_APP_ID_MAINNET) || (inputs.environment == 'testnet' && vars.XGOV_REGISTRY_APP_ID_TESTNET) || (inputs.environment == 'localnet' && vars.XGOV_REGISTRY_APP_ID_LOCALNET) || '' }}
108131
# Mainnet Vault configuration for transaction signing

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tool.poetry]
22
package-mode = false
33
name = "xgov-beta-sc"
4-
version = "1.1.1"
4+
version = "1.1.2"
55
description = "Algorand xGov Beta Smart Contracts"
66
authors = ["Algorand Foundation <[email protected]>"]
77
readme = "README.md"

0 commit comments

Comments
 (0)