Skip to content

Commit a6fd2eb

Browse files
galarghrjan90
andauthored
feat: ci: automate the new release process (#12096)
Co-authored-by: Phi-rjan <orjan.roren@gmail.com>
1 parent b4acecd commit a6fd2eb

File tree

10 files changed

+529
-359
lines changed

10 files changed

+529
-359
lines changed

.github/workflows/docker.yml

+15-13
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,21 @@ on:
44
push:
55
branches:
66
- master
7-
- release/*
87
tags:
98
- v*
9+
pull_request:
10+
branches:
11+
- master
12+
- release/v*
13+
- release/miner/v*
1014
schedule:
1115
- cron: '0 0 * * *'
1216
workflow_dispatch:
1317
inputs:
14-
ref:
15-
description: The GitHub ref (e.g. refs/tags/v1.0.0) to release
18+
publish:
19+
description: 'Publish the Docker image'
1620
required: false
21+
default: 'false'
1722

1823
defaults:
1924
run:
@@ -24,7 +29,7 @@ permissions:
2429

2530
jobs:
2631
docker:
27-
name: Docker (${{ matrix.image }} / ${{ matrix.network }}) [publish=${{ (inputs.ref || github.ref) == 'refs/heads/master' || startsWith(inputs.ref || github.ref, 'refs/tags/') }}]
32+
name: Docker (${{ matrix.image }} / ${{ matrix.network }}) [publish=${{ github.event.inputs.publish == 'true' || github.event_name != 'pull_request' }}]
2833
runs-on: ubuntu-latest
2934
strategy:
3035
fail-fast: false
@@ -40,13 +45,13 @@ jobs:
4045
- image: lotus
4146
network: mainnet
4247
env:
43-
PUBLISH: ${{ github.ref == 'refs/heads/master' || startsWith(inputs.ref || github.ref, 'refs/tags/') }}
48+
PUBLISH: ${{ github.event.inputs.publish == 'true' || github.event_name != 'pull_request' }}
4449
steps:
4550
- id: channel
4651
env:
47-
IS_MASTER: ${{ (inputs.ref || github.ref) == 'refs/heads/master' }}
48-
IS_TAG: ${{ startsWith(inputs.ref || github.ref, 'refs/tags/') }}
49-
IS_RC: ${{ contains(inputs.ref || github.ref, '-rc') }}
52+
IS_MASTER: ${{ github.ref == 'refs/heads/master' }}
53+
IS_TAG: ${{ startsWith(github.ref, 'refs/tags/') }}
54+
IS_RC: ${{ contains(github.ref, '-rc') }}
5055
IS_SCHEDULED: ${{ github.event_name == 'schedule' }}
5156
run: |
5257
channel=''
@@ -67,12 +72,9 @@ jobs:
6772
- uses: actions/checkout@v4
6873
with:
6974
submodules: 'recursive'
70-
ref: ${{ inputs.ref || github.ref }}
7175
- id: git
72-
env:
73-
REF: ${{ inputs.ref || github.ref }}
7476
run: |
75-
ref="${REF#refs/heads/}"
77+
ref="${GITHUB_REF#refs/heads/}"
7678
ref="${ref#refs/tags/}"
7779
sha="$(git rev-parse --short HEAD)"
7880
echo "ref=$ref" | tee -a "$GITHUB_OUTPUT"
@@ -86,7 +88,7 @@ jobs:
8688
images: filecoin/${{ matrix.image }}
8789
tags: |
8890
type=raw,enable=${{ steps.channel.outputs.channel != '' }},value=${{ steps.channel.outputs.channel }}
89-
type=raw,enable=${{ startsWith(inputs.ref || github.ref, 'refs/tags/') }},value=${{ steps.git.outputs.ref }}
91+
type=raw,enable=${{ startsWith(github.ref, 'refs/tags/') }},value=${{ steps.git.outputs.ref }}
9092
type=raw,value=${{ steps.git.outputs.sha }}
9193
flavor: |
9294
latest=false

0 commit comments

Comments
 (0)