-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f15393d
commit 8890440
Showing
5 changed files
with
63 additions
and
38 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
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 | ||
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 | ||
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 | ||
run: cargo publish -p prdoclib --token "${CRATESIO_TOKEN}" | ||
env: | ||
CRATESIO_TOKEN: ${{ secrets.CRATESIO_TOKEN }} | ||
|
||
- name: Build and publish prdoc | ||
# `set-version` will change Cargo.toml in `cli` package as it depends on `prdoclib` | ||
# thus, we need --allow-dirty, to include uncommitted changes; | ||
run: cargo publish --allow-dirty -p prdoc --token "${CRATESIO_TOKEN}" | ||
env: | ||
CRATESIO_TOKEN: ${{ secrets.CRATESIO_TOKEN }} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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