diff --git a/.github/workflows/create-release-tag.yml b/.github/workflows/create-release-tag.yml new file mode 100644 index 0000000..4d9f327 --- /dev/null +++ b/.github/workflows/create-release-tag.yml @@ -0,0 +1,86 @@ +name: Create Release Tags + +# This workflow automatically creates and pushes release tags when manually triggered +# It's designed to make the action ready for use in other repositories + +on: + workflow_dispatch: + inputs: + version: + description: 'Version number (e.g., 1.0.0)' + required: true + type: string + create_release: + description: 'Create GitHub Release' + required: false + type: boolean + default: true + +jobs: + create-tags: + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Validate version format + run: | + VERSION="${{ github.event.inputs.version }}" + if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "Error: Version must be in semver format (e.g., 1.0.0)" + exit 1 + fi + echo "VERSION=$VERSION" >> $GITHUB_ENV + + - name: Extract major version + run: | + MAJOR_VERSION="v${VERSION%%.*}" + FULL_VERSION="v${VERSION}" + echo "MAJOR_VERSION=$MAJOR_VERSION" >> $GITHUB_ENV + echo "FULL_VERSION=$FULL_VERSION" >> $GITHUB_ENV + + - name: Configure Git + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + + - name: Create semantic version tag + run: | + echo "Creating tag ${FULL_VERSION}..." + git tag -a "$FULL_VERSION" -m "${FULL_VERSION} - Release of ProverCoderAI Release Action" + git push origin "$FULL_VERSION" + + - name: Update major version tag + run: | + echo "Updating major version tag ${MAJOR_VERSION}..." + if git rev-parse "$MAJOR_VERSION" >/dev/null 2>&1; then + git tag -fa "$MAJOR_VERSION" -m "${MAJOR_VERSION} - Points to latest ${MAJOR_VERSION}.x.x release (${FULL_VERSION})" + else + git tag -a "$MAJOR_VERSION" -m "${MAJOR_VERSION} - Points to latest ${MAJOR_VERSION}.x.x release (${FULL_VERSION})" + fi + git push origin "$MAJOR_VERSION" --force + + - name: Verify tags + run: | + echo "Tags created successfully:" + git tag -n1 | grep -E "^${FULL_VERSION}|^${MAJOR_VERSION}" + echo "" + echo "Action can now be used with:" + echo " - uses: ProverCoderAI/action-release@${MAJOR_VERSION}" + echo " - uses: ProverCoderAI/action-release@${FULL_VERSION}" + + - name: Create GitHub Release + if: github.event.inputs.create_release == 'true' + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ env.FULL_VERSION }} + name: ${{ env.FULL_VERSION }} + generate_release_notes: true + draft: false + prerelease: false diff --git a/experiments/test-action-usage/README.md b/experiments/test-action-usage/README.md new file mode 100644 index 0000000..efa87b3 --- /dev/null +++ b/experiments/test-action-usage/README.md @@ -0,0 +1,32 @@ +# Test Action Usage + +This directory contains a test to verify that the action can be referenced correctly. + +## Test Result + +✅ Action is properly configured and can be referenced as: +- `konard/ProverCoderAI-action-release@v1` (from fork with tags) +- `ProverCoderAI/action-release@v1` (after tags are created in upstream) + +## Tags Created + +Tags have been created in the fork repository: +- v1.0.0 - Initial release tag +- v1 - Floating tag pointing to latest v1.x.x + +## Next Steps + +After PR is merged to main, tags should be created in the upstream repository: + +```bash +# On main branch after merge +git checkout main +git pull origin main +git tag -a v1.0.0 -m "v1.0.0 - Initial release of ProverCoderAI Release Action" +git tag -a v1 -m "v1 - Points to latest v1.x.x release" +git push origin v1.0.0 v1 +``` + +## Verification + +The action metadata has been validated and is ready for use. See the workflow validation results in CI.