mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-23 03:33:53 +00:00
68 lines
2.0 KiB
YAML
68 lines
2.0 KiB
YAML
name: Create Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*.*.*' # Trigger on version tags like v1.0.0, v1.2.3, etc.
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write # Needed to create releases
|
|
|
|
jobs:
|
|
release:
|
|
name: Create GitHub Release
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.ref }} # Explicitly checkout the triggering tag/ref
|
|
|
|
- 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
|
|
uses: softprops/action-gh-release@v2 # Popular action for creating releases
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Provided by GitHub Actions
|
|
with:
|
|
draft: true # Create the release as a draft initially
|
|
# Optionally, you can generate release notes automatically:
|
|
# generate_release_notes: true
|
|
# Assets can be uploaded later if needed, e.g.:
|
|
# files: |
|
|
# ./release-*.zip |