This commit is contained in:
@@ -32,51 +32,18 @@ jobs:
|
|||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: npm run test:run
|
run: npm run test:run
|
||||||
|
|
||||||
- name: Configure Git
|
- name: Get current version
|
||||||
run: |
|
|
||||||
git config user.name "Gitea Actions"
|
|
||||||
git config user.email "actions@gitea.com"
|
|
||||||
|
|
||||||
- name: Determine version bump type
|
|
||||||
id: bump_type
|
|
||||||
run: |
|
|
||||||
# Get commits since last tag
|
|
||||||
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
|
|
||||||
if [ -z "$LAST_TAG" ]; then
|
|
||||||
COMMITS=$(git log --oneline)
|
|
||||||
else
|
|
||||||
COMMITS=$(git log --oneline ${LAST_TAG}..HEAD)
|
|
||||||
fi
|
|
||||||
|
|
||||||
if echo "$COMMITS" | grep -q "BREAKING\|!:"; then
|
|
||||||
echo "bump=major" >> $GITHUB_OUTPUT
|
|
||||||
elif echo "$COMMITS" | grep -q "^feat"; then
|
|
||||||
echo "bump=minor" >> $GITHUB_OUTPUT
|
|
||||||
else
|
|
||||||
echo "bump=patch" >> $GITHUB_OUTPUT
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Bump version
|
|
||||||
id: version
|
id: version
|
||||||
run: |
|
run: |
|
||||||
BUMP="${{ steps.bump_type.outputs.bump }}"
|
# Read version from package.json
|
||||||
echo "Bumping version: $BUMP"
|
CURRENT_VERSION=$(node -p "require('./package.json').version")
|
||||||
npm run version:$BUMP
|
echo "version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
|
||||||
|
echo "Current version: $CURRENT_VERSION"
|
||||||
|
|
||||||
# Get new version
|
- name: Create git tag for release
|
||||||
NEW_VERSION=$(node -p "require('./package.json').version")
|
|
||||||
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Commit and push version bump
|
|
||||||
run: |
|
run: |
|
||||||
git add package.json CHANGELOG.md
|
git tag -a "v${{ steps.version.outputs.version }}" -m "Release v${{ steps.version.outputs.version }}"
|
||||||
git commit -m "chore: bump version to v${{ steps.version.outputs.new_version }}"
|
git push origin "v${{ steps.version.outputs.version }}"
|
||||||
git push origin main
|
|
||||||
|
|
||||||
- name: Create git tag
|
|
||||||
run: |
|
|
||||||
git tag -a "v${{ steps.version.outputs.new_version }}" -m "Release v${{ steps.version.outputs.new_version }}"
|
|
||||||
git push origin "v${{ steps.version.outputs.new_version }}"
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
@@ -86,7 +53,7 @@ jobs:
|
|||||||
# Build with docker.notsosm.art registry
|
# Build with docker.notsosm.art registry
|
||||||
docker build \
|
docker build \
|
||||||
--build-arg GIT_COMMIT=${{ github.sha }} \
|
--build-arg GIT_COMMIT=${{ github.sha }} \
|
||||||
-t docker.notsosm.art/euchre-camp:${{ steps.version.outputs.new_version }} \
|
-t docker.notsosm.art/euchre-camp:${{ steps.version.outputs.version }} \
|
||||||
-t docker.notsosm.art/euchre-camp:latest \
|
-t docker.notsosm.art/euchre-camp:latest \
|
||||||
.
|
.
|
||||||
|
|
||||||
@@ -94,7 +61,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
# Push to docker.notsosm.art registry
|
# Push to docker.notsosm.art registry
|
||||||
echo "Pushing to docker.notsosm.art..."
|
echo "Pushing to docker.notsosm.art..."
|
||||||
docker push docker.notsosm.art/euchre-camp:${{ steps.version.outputs.new_version }}
|
docker push docker.notsosm.art/euchre-camp:${{ steps.version.outputs.version }}
|
||||||
docker push docker.notsosm.art/euchre-camp:latest
|
docker push docker.notsosm.art/euchre-camp:latest
|
||||||
|
|
||||||
- name: Deploy to dev (placeholder)
|
- name: Deploy to dev (placeholder)
|
||||||
|
|||||||
Reference in New Issue
Block a user