Skip to content

Commit e3aaf52

Browse files
committed
Add missed .github/workflows files for the previous commit
1 parent 15c4ec6 commit e3aaf52

File tree

2 files changed

+143
-0
lines changed

2 files changed

+143
-0
lines changed
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# This workflow is meant to trigger a build of Docker binaries when a release
2+
# is published, it uses the existing `zfnd-build-docker-image.yml` workflow
3+
#
4+
# We use a separate action as we might want to trigger this under
5+
# different circumstances than a Continuous Deployment, for example.
6+
#
7+
# This workflow is triggered if:
8+
# - A release is published
9+
# - A pre-release is changed to a release
10+
name: Release binaries
11+
12+
on:
13+
release:
14+
types:
15+
- released
16+
17+
permissions:
18+
contents: read
19+
20+
jobs:
21+
# The image will be named `zebra:<semver>`
22+
build:
23+
name: Build Release Docker
24+
permissions:
25+
contents: read
26+
id-token: write
27+
pull-requests: write
28+
uses: ./.github/workflows/zfnd-build-docker-image.yml
29+
with:
30+
dockerfile_path: ./docker/Dockerfile
31+
dockerfile_target: runtime
32+
image_name: zebra
33+
short_sha: ''
34+
features: ${{ vars.RUST_PROD_FEATURES }}
35+
rust_log: ${{ vars.RUST_LOG }}
36+
# Enable Docker Hub publishing for official releases (this is the single source of truth for production images)
37+
# The deploy-nodes workflow also builds for releases but doesn't publish to Docker Hub (defaults to false)
38+
publish_to_dockerhub: true
39+
# This step needs access to Docker Hub secrets to run successfully
40+
secrets:
41+
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
42+
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
43+
44+
dockerhub-description:
45+
if: github.repository_owner == 'ZcashFoundation'
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 #v6.0.1
49+
with:
50+
persist-credentials: false
51+
52+
- name: Docker Hub Description
53+
uses: peter-evans/dockerhub-description@1b9a80c056b620d92cedb9d9b5a223409c68ddfa #v5.0.0
54+
with:
55+
username: ${{ secrets.DOCKERHUB_USERNAME }}
56+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
57+
repository: zfnd/zebra
58+
short-description: ${{ github.event.repository.description }}
59+
60+
release-binaries-success:
61+
name: Release binaries success
62+
runs-on: ubuntu-latest
63+
# Only run when the Docker Hub update job is allowed to execute
64+
if: >-
65+
${{
66+
always() &&
67+
github.repository_owner == 'ZcashFoundation'
68+
}}
69+
needs:
70+
- build
71+
- dockerhub-description
72+
timeout-minutes: 1
73+
steps:
74+
- name: Decide whether the needed jobs succeeded or failed
75+
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe #v1.2.2
76+
with:
77+
jobs: ${{ toJSON(needs) }}
78+
79+
failure-issue:
80+
name: Open or update issues for release binaries failures
81+
# When a new job is added to this workflow, add it to this list.
82+
needs: [ build, dockerhub-description ]
83+
# Open tickets for any failed build in this workflow.
84+
if: failure() || cancelled()
85+
runs-on: ubuntu-latest
86+
permissions:
87+
issues: write
88+
steps:
89+
- uses: jayqi/failed-build-issue-action@1a893bbf43ef1c2a8705e2b115cd4f0fe3c5649b #v1.2.0
90+
with:
91+
title-template: "{{refname}} branch CI failed: {{eventName}} in {{workflow}}"
92+
# New failures open an issue with this label.
93+
label-name: S-ci-fail-binaries-auto-issue
94+
# If there is already an open issue with this label, any failures become comments on that issue.
95+
always-create-new-issue: false
96+
github-token: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# This workflow automates the creation and updating of draft releases. It compiles PR titles into the draft release notes.
2+
# https://github.com/ZcashFoundation/zebra/releases
3+
#
4+
# - Updates the draft release upon each merge into 'main'.
5+
# - Utilizes the release-drafter GitHub Action to accumulate PR titles since the last release into a draft release note.
6+
# - Suitable permissions are set for creating releases and handling pull requests.
7+
#
8+
# Workflow is based on:
9+
# https://github.com/marketplace/actions/release-drafter#usage
10+
name: Release Drafter
11+
12+
on:
13+
# Automatically update the draft release every time a PR merges to `main`
14+
push:
15+
branches:
16+
- main
17+
# pull_request event is required only for autolabeler
18+
pull_request:
19+
# Only following types are handled by the action
20+
types: [opened, reopened, synchronize]
21+
# pull_request_target event is required for autolabeler to support PRs from forks
22+
pull_request_target:
23+
#types: [opened, reopened, synchronize]
24+
# Manually update the draft release without waiting for a PR to merge
25+
workflow_dispatch:
26+
27+
permissions:
28+
contents: read
29+
30+
jobs:
31+
update_release_draft:
32+
permissions:
33+
# write permission is required to create a github release
34+
contents: write
35+
# write permission is required for autolabeler
36+
# otherwise, read permission is required at least
37+
pull-requests: write
38+
runs-on: ubuntu-latest
39+
steps:
40+
# Drafts your next Release notes
41+
- uses: release-drafter/release-drafter@267d2e0268deae5d44f3ba5029dd4d6e85f9d52d # v6.1.1
42+
with:
43+
config-name: release-drafter.yml
44+
commitish: main
45+
#disable-autolabeler: true
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)