@@ -46,54 +46,35 @@ jobs:
4646 username : ${{ github.actor }}
4747 password : ${{ secrets.GHCR_TOKEN }}
4848
49- - name : Check registry access
50- run : |
51- echo "Testing registry authentication..."
52- if ! docker pull ghcr.io/rapidfort/smithy:latest 2>/dev/null; then
53- echo "⚠️ Package may not exist yet. This is normal for first publish."
54- else
55- echo "✅ Package exists and is accessible"
56- fi
57-
5849 - name : Extract version metadata
5950 id : meta
6051 run : |
61- # Get version from tag or use manual input
52+ # Get version from tag (strip 'v' prefix: v1.0.3 -> 1.0.3)
6253 if [[ "${{ github.ref }}" == refs/tags/* ]]; then
63- # Strip 'v' prefix from tag (v1.0.3 -> 1.0.3)
6454 VERSION=${GITHUB_REF#refs/tags/}
6555 VERSION=${VERSION#v}
66- RELEASE_TYPE="production"
6756 else
6857 VERSION=$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//' || echo "0.0.0")
69- RELEASE_TYPE="${{ github.event.inputs.release_type || 'staging' }}"
7058 fi
7159
7260 COMMIT=$(git rev-parse --short HEAD)
7361 BRANCH=$(git rev-parse --abbrev-ref HEAD)
7462 BUILD_DATE=$(date +%s)
7563
7664 echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
77- echo "RELEASE_TYPE=${RELEASE_TYPE}" >> $GITHUB_OUTPUT
7865 echo "COMMIT=${COMMIT}" >> $GITHUB_OUTPUT
7966 echo "BRANCH=${BRANCH}" >> $GITHUB_OUTPUT
8067 echo "BUILD_DATE=${BUILD_DATE}" >> $GITHUB_OUTPUT
8168
8269 echo "📦 Building version: ${VERSION}"
83- echo "🏷️ Release type: ${RELEASE_TYPE}"
8470
8571 - name : Generate Docker tags
8672 id : tags
8773 run : |
8874 VERSION="${{ steps.meta.outputs.VERSION }}"
89- RELEASE_TYPE="${{ steps.meta.outputs.RELEASE_TYPE }}"
9075 IMAGE="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}"
9176
92- if [[ "$RELEASE_TYPE" == "staging" ]]; then
93- TAGS="${IMAGE}:${VERSION}-staging"
94- else
95- TAGS="${IMAGE}:${VERSION},${IMAGE}:latest"
96- fi
77+ TAGS="${IMAGE}:${VERSION},${IMAGE}:latest"
9778
9879 echo "TAGS=${TAGS}" >> $GITHUB_OUTPUT
9980 echo "🏷️ Tags: ${TAGS}"
@@ -164,3 +145,4 @@ jobs:
164145 echo " git push origin v${{ needs.build-and-push.outputs.VERSION }}"
165146 echo ""
166147 echo "Or run: make release-publish VERSION=${{ needs.build-and-push.outputs.VERSION }}-staging"
148+
0 commit comments