Skip to content

docs: add readme notes #2

docs: add readme notes

docs: add readme notes #2

Workflow file for this run

---
name: Semantic Release
on:
push:
branches:
- main
jobs:
semantic-release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
outputs:
next-version: ${{ steps.semantic-release.outputs.next-version }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "lts/*"
- name: Install Semantic Release
run: >
npm install
semantic-release
conventional-changelog-conventionalcommits
@semantic-release/changelog
@semantic-release/exec
@semantic-release/git
semantic-release-major-tag
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
run: npm audit signatures
- name: Run Semantic Release
id: semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npx semantic-release
VERSION=$(cat VERSION || echo "")
echo "Next version: $VERSION"
echo "next-version=$VERSION" >> $GITHUB_OUTPUT
docker:
runs-on: ubuntu-latest
needs: semantic-release
if: ${{ needs.semantic-release.outputs.next-version }}
permissions:
packages: write # required to push to GHCR
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker image
run: |
IMAGE_NAME="ghcr.io/${{ github.repository_owner }}/cpp-cli"
V_TAG="${IMAGE_NAME}:v${{ needs.semantic-release.outputs.next-version }}"
LATEST_TAG="${IMAGE_NAME}:latest"
echo "Building image $V_TAG and $LATEST_TAG"
docker build -t "$V_TAG" -t "$LATEST_TAG" .
- name: Push Docker image
run: |
IMAGE_NAME="ghcr.io/${{ github.repository_owner }}/cpp-cli"
docker push "${IMAGE_NAME}:v${{ needs.semantic-release.outputs.next-version }}"
docker push "${IMAGE_NAME}:latest"