Another release workflow fix (#1190) #171
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- '*.*.*' | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-22.04 | |
env: | |
DOCKER_REGISTRY: ghcr.io | |
DOCKER_IMAGE_NAME: ${{ github.repository }} | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
# NOTE: Fetch full history for Sentry release | |
with: | |
fetch-depth: 0 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
install: true | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Log in to GHCR | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.DOCKER_REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Docker metadata | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
dipdup/dipdup | |
${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }} | |
flavor: | | |
latest=false | |
tags: | | |
type=pep440,pattern={{version}} | |
type=pep440,pattern={{major}} | |
type=pep440,pattern={{major}}.{{minor}} | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
cache: 'pip' | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
- name: Run install | |
run: make install | |
- name: Run all checks | |
run: uv run make all | |
env: | |
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }} | |
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }} | |
ONFINALITY_API_KEY: ${{ secrets.ONFINALITY_API_KEY }} | |
- name: Publish stable image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: Publish package on PyPi | |
run: uv build && uv publish --token ${{secrets.PYPI_TOKEN}} | |
# FIXME: Fails on prereleases; https://github.com/mindsers/changelog-reader-action/pull/39 | |
- name: Parse changelog | |
id: changelog | |
uses: mindsers/changelog-reader-action@v2 | |
with: | |
version: ${{ github.ref_name }} | |
- name: Publish GitHub release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref_name }} | |
release_name: ${{ steps.changelog.outputs.version }} | |
body: | | |
## ${{ steps.changelog.outputs.version }} - ${{ steps.changelog.outputs.date }} | |
${{ steps.changelog.outputs.changes }} | |
draft: false | |
prerelease: ${{ steps.changelog.outputs.status == 'prereleased' }} | |
- name: Create Sentry release | |
uses: getsentry/action-release@v1 | |
with: | |
version: ${{ steps.changelog.outputs.version }} | |
ignore_missing: true | |
env: | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
SENTRY_ORG: sentry | |
SENTRY_PROJECT: dipdup | |
SENTRY_URL: ${{ secrets.SENTRY_URL }} |