mirror of
https://github.com/phin05/discord-rich-presence-plex
synced 2024-11-22 09:33:07 +00:00
62 lines
2 KiB
YAML
62 lines
2 KiB
YAML
|
name: Release
|
||
|
run-name: Release ${{ inputs.version || github.ref_name }}
|
||
|
on:
|
||
|
push:
|
||
|
tags:
|
||
|
- v*
|
||
|
workflow_dispatch:
|
||
|
inputs:
|
||
|
version:
|
||
|
required: true
|
||
|
type: string
|
||
|
description: Version (vX.X.X)
|
||
|
env:
|
||
|
VERSION: ${{ inputs.version || github.ref_name }}
|
||
|
jobs:
|
||
|
release-zip:
|
||
|
runs-on: ubuntu-latest
|
||
|
permissions:
|
||
|
contents: write
|
||
|
env:
|
||
|
RELEASE_ZIP_FILENAME: ${{ github.event.repository.name }}-${{ inputs.version || github.ref_name }}.zip
|
||
|
steps:
|
||
|
- name: Checkout repository
|
||
|
uses: actions/checkout@v4
|
||
|
- name: Create release ZIP file
|
||
|
run: |
|
||
|
mkdir ${{ github.event.repository.name }}
|
||
|
rm -rf .git .github .gitignore .dockerignore Dockerfile CONTRIBUTING.md pyrightconfig.json
|
||
|
mv * ${{ github.event.repository.name }} || true
|
||
|
zip -r $RELEASE_ZIP_FILENAME ${{ github.event.repository.name }}
|
||
|
- name: Release on GitHub
|
||
|
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
|
||
|
with:
|
||
|
tag_name: ${{ env.VERSION }}
|
||
|
generate_release_notes: true
|
||
|
files: ${{ env.RELEASE_ZIP_FILENAME }}
|
||
|
release-docker:
|
||
|
runs-on: ubuntu-latest
|
||
|
permissions:
|
||
|
packages: write
|
||
|
env:
|
||
|
DOCKER_IMAGE_NAME: ghcr.io/${{ github.actor }}/${{ github.event.repository.name }}
|
||
|
steps:
|
||
|
- name: Checkout repository
|
||
|
uses: actions/checkout@v4
|
||
|
- name: Sign into GitHub Container Registry
|
||
|
uses: docker/login-action@v2
|
||
|
with:
|
||
|
registry: ghcr.io
|
||
|
username: ${{ github.actor }}
|
||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||
|
- name: Set up Docker Buildx
|
||
|
uses: docker/setup-buildx-action@v2
|
||
|
- name: Build and push Docker images
|
||
|
uses: docker/build-push-action@v4
|
||
|
with:
|
||
|
context: .
|
||
|
platforms: linux/amd64,linux/arm64
|
||
|
push: true
|
||
|
provenance: false
|
||
|
tags: ${{ env.DOCKER_IMAGE_NAME }}:${{ env.VERSION }},${{ env.DOCKER_IMAGE_NAME }}:latest
|