using --allow-dirty for publishing changed version (#43) #4
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: Publish Docker image and crates | |
on: | |
push: | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+" | |
jobs: | |
push_to_registry: | |
name: Push Docker image to Docker Hub | |
runs-on: ubuntu-latest | |
environment: releases | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175 # v4.6.0 | |
with: | |
images: paritytech/prdoc | |
- name: Build and push Docker image | |
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 #v4.1.1 | |
with: | |
file: Dockerfile | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
publish_crates: | |
name: Publish crates to crates.io | |
runs-on: ubuntu-latest | |
environment: releases | |
container: | |
image: docker.io/paritytech/ci-unified:bullseye-1.79.0-2024-06-10-v202408151233 | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
- name: set version | |
# removing leading "v" from tag name | |
run: cargo set-version "$(echo "${{ github.ref_name }}" | sed -e 's/^v//')" | |
- name: Build and publish prdoclib | |
# `set-version` will change Cargo.toml and Cargo.lock | |
# thus, we need --allow-dirty, to include uncommitted changes; | |
run: cargo publish --allow-dirty -p parity-prdoc --token "${CRATESIO_TOKEN}" | |
env: | |
CRATESIO_TOKEN: ${{ secrets.CRATESIO_TOKEN }} |