Skip to content

Commit

Permalink
ci: add workflow for release and publishing (#10)
Browse files Browse the repository at this point in the history
Release-As: 61.2.0
  • Loading branch information
ariwk authored Jun 4, 2024
1 parent d16f289 commit 65d1241
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 27 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
name: Build & Release
on:
push:
branches: ['*']
pull_request:
branches: [main]
permissions:
contents: write
pull-requests: write
packages: write
env:
# login to GitHub registry using the default credentials associated with pipeline
REGISTRY: ghcr.io
REGISTRY_USERNAME: ${{ github.actor }}
REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
# Image name will be <account>/<repo>
IMAGE_NAME: ${{ github.repository }}
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: rp
if: github.event_name != 'pull_request' && github.ref_name == 'main'
uses: google-github-actions/release-please-action@v4
with:
release-type: simple
include-v-in-tags: false
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.REGISTRY_USERNAME }}
password: ${{ env.REGISTRY_PASSWORD }}
- name: Prepare tags for Docker meta
id: tags
env:
# When release-please is skipped, these values will be empty
is_release: ${{ steps.rp.outputs.release_created }}
version: v${{ steps.rp.outputs.major }}.${{ steps.rp.outputs.minor }}.${{
steps.rp.outputs.patch }}
run: |
tags=""
if [[ "$is_release" = 'true' ]]; then
tags="type=semver,pattern={{version}},value=$version
type=semver,pattern={{major}},value=$version
type=semver,pattern={{major}}.{{minor}},value=$version"
else
tags="type=ref,event=branch
type=ref,event=pr"
fi
{
echo 'tags<<EOF'
echo "$tags"
echo EOF
} >> "$GITHUB_OUTPUT"
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: ${{ steps.tags.outputs.tags }}
# necessary for multi-platform images
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# necessary for multi-platform images
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
provenance: false
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
# (optional) Add build arguments. I like to have the version available to the build so the app can show it.
build-args: APP_VERSION=${{ steps.meta.outputs.version }}
18 changes: 0 additions & 18 deletions .github/workflows/release-please.yml

This file was deleted.

9 changes: 0 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,3 @@ Weasyprint Service provides the following endpoints:
> ```
</details>
------------------------------------------------------------------------------------------
## Changelog
| Version | Changes |
|---------|----------------------------------------------|
| v1.2.0 | Replacing svg images with png using chromium |
| v1.1.0 | Repository refactored + readme updated |
| v1.0.0 | Initial contribution |

0 comments on commit 65d1241

Please sign in to comment.