xiaomusic/.github/workflows/release.yml

66 lines
1.8 KiB
YAML
Raw Normal View History

2023-10-15 02:58:53 +00:00
name: Release and Build Docker Image
2023-10-14 11:50:32 +00:00
permissions:
contents: write
on:
push:
tags:
2024-09-03 22:56:59 +00:00
- "v*"
2023-10-15 02:58:53 +00:00
workflow_dispatch:
2023-10-14 11:50:32 +00:00
jobs:
2024-07-26 14:21:43 +00:00
pypi-publish:
name: upload release to PyPI
2023-10-14 11:50:32 +00:00
runs-on: ubuntu-latest
2024-07-26 14:21:43 +00:00
permissions:
2024-07-28 21:51:04 +00:00
contents: write
2024-07-26 14:21:43 +00:00
id-token: write
2023-10-14 11:50:32 +00:00
steps:
2024-09-03 22:56:38 +00:00
- uses: actions/checkout@v4
2024-07-28 13:58:44 +00:00
with:
fetch-depth: 0
2023-10-14 11:50:32 +00:00
2024-09-03 22:56:38 +00:00
- uses: actions/setup-node@v4
2024-07-28 20:48:39 +00:00
with:
2024-09-03 22:56:38 +00:00
registry-url: https://registry.npmjs.org/
node-version: lts/*
2024-07-28 20:48:39 +00:00
2024-07-28 09:33:43 +00:00
- run: npx changelogithub
continue-on-error: true
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
2024-09-02 01:09:49 +00:00
- uses: pdm-project/setup-pdm@v3
- name: Publish package distributions to PyPI
run: pdm publish
2023-10-15 02:58:53 +00:00
build-image:
runs-on: ubuntu-latest
# run unless event type is pull_request
if: github.event_name != 'pull_request'
2024-10-30 04:58:18 +00:00
strategy:
matrix:
platform: [linux/amd64, linux/arm64, linux/arm/v7]
2023-10-15 02:58:53 +00:00
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
2024-10-30 04:58:18 +00:00
platforms: ${{ matrix.platform }}
2023-10-15 02:58:53 +00:00
push: true
2024-01-27 14:44:23 +00:00
tags: ${{ secrets.DOCKERHUB_USERNAME }}/xiaomusic:${{ github.ref_name }}, ${{ secrets.DOCKERHUB_USERNAME }}/xiaomusic:latest, ${{ secrets.DOCKERHUB_USERNAME }}/xiaomusic:stable
2024-10-30 05:14:54 +00:00
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new