Files
pulse/.github/workflows/release.yml
T
2025-04-30 22:47:59 +01:00

65 lines
1.9 KiB
YAML

name: Create Release
on:
push:
tags:
- 'v*.*.*' # Trigger ONLY on version tags like v1.0.0, v1.2.3, etc.
permissions:
contents: write # Needed to create releases and write release notes
jobs:
release:
name: Create GitHub Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.ref }} # Checkout the specific tag that triggered the run
fetch-depth: 0 # Fetch history for release notes generation
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x' # Match the CI workflow version
- name: Clean install dependencies
run: rm -rf node_modules && npm ci
- name: Run tests
# Simplified test command
run: npm test # Important: Ensure tests pass before releasing
# --- Add Docker Steps ---
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64 # Add other platforms if needed
push: true
tags: |
rcourtman/pulse:${{ github.ref_name }}
rcourtman/pulse:latest
# --- End Docker Steps ---
- name: Create GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${{ github.ref_name }} \
--title "Release ${{ github.ref_name }}" \
--generate-notes \
--draft # Keep as draft initially