Skip to content

Commit

Permalink
fix: release workflow with semantic exec version pass
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemental committed Oct 23, 2024
1 parent 42be0cc commit bd8f9e7
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 50 deletions.
47 changes: 0 additions & 47 deletions .github/workflows/build.yml

This file was deleted.

42 changes: 41 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ on:
workflow_dispatch:

jobs:
release:
semantic:
name: Semantic Release
runs-on: ubuntu-latest
outputs:
version: ${{ steps.semantic-release.outputs.version }}
permissions:
contents: write
issues: write
Expand All @@ -26,6 +28,44 @@ jobs:
run: npm ci

- name: Run semantic-release
id: semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release

docker:
name: Docker Build Push
runs-on: ubuntu-latest
needs: semantic

steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Docker meta
uses: docker/metadata-action@v5
id: meta
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=raw,value=latest
type=raw,value=${{ steps.semantic-release.outputs.version }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v6
with:
file: Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
provenance: false
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
5 changes: 3 additions & 2 deletions .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/github",
["@semantic-release/git", {
"message": "chore(release): ${nextRelease.version}\n\n${nextRelease.notes}"
"@semantic-release/git",
["@semantic-release/exec", {
"verifyReleaseCmd": "echo \"version=${nextRelease.version}\" >> $GITHUB_OUTPUT"
}]
]
}
41 changes: 41 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"semantic-release": "^24.0.0",
"@semantic-release/changelog": "^6.0.0",
"@semantic-release/git": "^10.0.0",
"@semantic-release/exec": "^6.0.0",
"@semantic-release/github": "^11.0.0",
"@semantic-release/commit-analyzer": "^13.0.0",
"@semantic-release/release-notes-generator": "^14.0.0"
Expand Down

0 comments on commit bd8f9e7

Please sign in to comment.