Skip to content

docs: Remove duplicate changelog entries #14

docs: Remove duplicate changelog entries

docs: Remove duplicate changelog entries #14

name: Continuous Delivery
on:
push:
branches:
- main
concurrency: continuous-delivery
jobs:
semantic-release:
name: Semantic Release
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
released: ${{ steps.semantic-release.outputs.released }}
tag: ${{ steps.semantic-release.outputs.tag }}
version: ${{ steps.semantic-release.outputs.version }}
sha: ${{ steps.git-rev-parse.outputs.sha }}
steps:
# We need to checkout the repository at the workflow hash in case the
# branch was updated while the workflow was running
- name: Setup | Checkout repository at workflow hash
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.sha }}
# To keep PSR working with the configured release branches, we force a
# checkout of the desired release branch but at the workflow hash HEAD
- name: Setup | Force correct release branch on workflow hash
run: |
git checkout -B ${{ github.ref_name }} ${{ github.sha }}
- name: Action | Semantic version release
id: semantic-release
uses: python-semantic-release/python-semantic-release@v9.19.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
git_committer_name: "github-actions[bot]"
git_committer_email: "41898282+github-actions[bot]@users.noreply.github.com"
- name: Artifact | Store Python package distribution
uses: actions/upload-artifact@v4
if: steps.semantic-release.outputs.released == 'true'
with:
name: PlexMusicRatingsSync-${{ steps.semantic-release.outputs.tag }}
path: dist/
include-hidden-files: true
if-no-files-found: error
- name: Action | Read the latest commit hash from the repository
id: git-rev-parse
if: steps.semantic-release.outputs.released == 'true'
run: |
echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
python-package:
name: Python Package
runs-on: ubuntu-latest
needs: semantic-release
permissions:
contents: read
id-token: write
environment:
name: PyPI
url: https://pypi.org/p/PlexMusicRatingsSync
if: |
needs.semantic-release.result == 'success' &&
needs.semantic-release.outputs.released == 'true'
steps:
- name: Setup | Checkout repository at semantic release hash
uses: actions/checkout@v4
with:
ref: ${{ needs.semantic-release.outputs.sha }}
- name: Artifact | Restore Python package distribution
uses: actions/download-artifact@v4
with:
name: PlexMusicRatingsSync-${{ needs.semantic-release.outputs.tag }}
path: dist/
- name: Publish | Upload package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
docker-image:
name: Docker Image
runs-on: ubuntu-latest
needs: semantic-release
permissions:
attestations: write
contents: read
packages: write
env:
GHCR_PACKAGE_NAME: ${{ github.repository_owner }}/plex-music-ratings-sync
if: |
needs.semantic-release.result == 'success' &&
needs.semantic-release.outputs.released == 'true'
steps:
- name: Setup | Checkout repository at semantic release hash
uses: actions/checkout@v4
with:
ref: ${{ needs.semantic-release.outputs.sha }}
- name: Setup | Extract metadata for the Docker image
id: meta
uses: docker/metadata-action@v5
with:
images: |
name=ghcr.io/${{ env.GHCR_PACKAGE_NAME }}
tags: |
type=semver,pattern={{major}},value=${{ needs.semantic-release.outputs.version }}
type=semver,pattern={{major}}.{{minor}},value=${{ needs.semantic-release.outputs.version }}
type=semver,pattern={{version}},value=${{ needs.semantic-release.outputs.version }}
- name: Setup | Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup | Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Action | Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
annotations: ${{ steps.meta.outputs.annotations }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}