Skip to content

Commit 2cc52cb

Browse files
authored
feat: adds support for custom releases (#71)
1 parent c8ac149 commit 2cc52cb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+5313
-96746
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,16 @@ jobs:
2727
outputs:
2828
deployments: ${{ steps.discovery.outputs.deployments }}
2929
earthfiles: ${{ steps.discovery.outputs.earthfiles }}
30+
releases: ${{ steps.discovery.outputs.releases }}
3031
steps:
3132
- uses: actions/checkout@v4
3233
- name: Install Forge
33-
uses: input-output-hk/catalyst-forge/actions/install@ci/v1.1.0
34+
uses: input-output-hk/catalyst-forge/actions/install@master
3435
if: ${{ inputs.forge_version != 'local' }}
3536
with:
3637
version: ${{ inputs.forge_version }}
3738
- name: Install Local Forge
38-
uses: input-output-hk/catalyst-forge/actions/install-local@ci/v1.1.0
39+
uses: input-output-hk/catalyst-forge/actions/install-local@master
3940
if: ${{ inputs.forge_version == 'local' }}
4041
with:
4142
earthly_token: ${{ secrets.earthly_token }}
@@ -50,14 +51,14 @@ jobs:
5051
echo "skip=false" >> $GITHUB_OUTPUT
5152
fi
5253
- name: Setup CI
53-
uses: input-output-hk/catalyst-forge/actions/setup@ci/v1.1.0
54+
uses: input-output-hk/catalyst-forge/actions/setup@master
5455
with:
5556
skip_docker: 'true'
5657
skip_github: 'true'
5758
skip_earthly: ${{ steps.local.outputs.skip }}
5859
- name: Discovery
5960
id: discovery
60-
uses: input-output-hk/catalyst-forge/actions/discovery@ci/v1.1.0
61+
uses: input-output-hk/catalyst-forge/actions/discovery@master
6162
with:
6263
filters: |
6364
${{ env.FORGE_REGEX_CHECK }}
@@ -69,7 +70,7 @@ jobs:
6970
${{ env.FORGE_REGEX_PUBLISH }}
7071
7172
check:
72-
uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@ci/v1.1.0
73+
uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@master
7374
needs: [discover]
7475
if: (fromJson(needs.discover.outputs.earthfiles)['^check(-.*)?$'] != null) && !failure() && !cancelled()
7576
with:
@@ -79,7 +80,7 @@ jobs:
7980
earthly_token: ${{ secrets.earthly_token }}
8081

8182
build:
82-
uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@ci/v1.1.0
83+
uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@master
8384
needs: [discover, check]
8485
if: (fromJson(needs.discover.outputs.earthfiles)['^build(-.*)?$'] != null) && !failure() && !cancelled()
8586
with:
@@ -89,7 +90,7 @@ jobs:
8990
earthly_token: ${{ secrets.earthly_token }}
9091

9192
package:
92-
uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@ci/v1.1.0
93+
uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@master
9394
needs: [discover, check, build]
9495
if: (fromJson(needs.discover.outputs.earthfiles)['^package(-.*)?$'] != null) && !failure() && !cancelled()
9596
with:
@@ -99,7 +100,7 @@ jobs:
99100
earthly_token: ${{ secrets.earthly_token }}
100101

101102
test:
102-
uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@ci/v1.1.0
103+
uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@master
103104
needs: [discover, check, build, package]
104105
if: (fromJson(needs.discover.outputs.earthfiles)['^test(-.*)?$'] != null) && !failure() && !cancelled()
105106
with:
@@ -109,7 +110,7 @@ jobs:
109110
earthly_token: ${{ secrets.earthly_token }}
110111

111112
docs:
112-
uses: input-output-hk/catalyst-forge/.github/workflows/docs.yml@ci/v1.1.0
113+
uses: input-output-hk/catalyst-forge/.github/workflows/docs.yml@master
113114
needs: [discover, check, build, test]
114115
if: (fromJson(needs.discover.outputs.earthfiles)['^docs(-.*)?$'] != null) && !failure() && !cancelled()
115116
with:
@@ -118,38 +119,28 @@ jobs:
118119
secrets:
119120
earthly_token: ${{ secrets.earthly_token }}
120121

121-
publish:
122-
uses: input-output-hk/catalyst-forge/.github/workflows/publish.yml@ci/v1.1.0
122+
release:
123+
uses: input-output-hk/catalyst-forge/.github/workflows/release.yml@master
123124
needs: [discover, check, build, test]
124-
if: (fromJson(needs.discover.outputs.earthfiles)['^publish(-.*)?$'] != null) && !failure() && !cancelled()
125+
if: (fromJson(needs.discover.outputs.releases)[0] != null) && !failure() && !cancelled()
125126
with:
126-
earthfiles: ${{ toJson(fromJson(needs.discover.outputs.earthfiles)['^publish(-.*)?$']) }}
127+
releases: ${{ needs.discover.outputs.releases }}
127128
forge_version: ${{ inputs.forge_version }}
128129
secrets:
129130
earthly_token: ${{ secrets.earthly_token }}
130131

131132
deploy:
132-
uses: input-output-hk/catalyst-forge/.github/workflows/deploy.yml@ci/v1.1.0
133-
needs: [discover, check, build, test, publish]
133+
uses: input-output-hk/catalyst-forge/.github/workflows/deploy.yml@master
134+
needs: [discover, check, build, test, release]
134135
if: (fromJson(needs.discover.outputs.deployments)[0] != null) && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && !failure() && !cancelled()
135136
with:
136137
deployments: ${{ needs.discover.outputs.deployments }}
137138
forge_version: ${{ inputs.forge_version }}
138139
secrets:
139140
earthly_token: ${{ secrets.earthly_token }}
140141

141-
release:
142-
uses: input-output-hk/catalyst-forge/.github/workflows/release.yml@ci/v1.1.0
143-
needs: [discover, check, build, test]
144-
if: (fromJson(needs.discover.outputs.earthfiles)['^release(-.*)?$'] != null) && !failure() && !cancelled()
145-
with:
146-
earthfiles: ${{ toJson(fromJson(needs.discover.outputs.earthfiles)['^release(-.*)?$']) }}
147-
forge_version: ${{ inputs.forge_version }}
148-
secrets:
149-
earthly_token: ${{ secrets.earthly_token }}
150-
151142
final:
152-
needs: [check, build, package, test, publish, release]
143+
needs: [check, build, package, test, release]
153144
if: (!failure() && !cancelled())
154145
runs-on: ubuntu-latest
155146
steps:

.github/workflows/deploy.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ jobs:
3131
steps:
3232
- uses: actions/checkout@v4
3333
- name: Install Forge
34-
uses: input-output-hk/catalyst-forge/actions/install@ci/v1.1.0
34+
uses: input-output-hk/catalyst-forge/actions/install@master
3535
if: ${{ inputs.forge_version != 'local' }}
3636
with:
3737
version: ${{ inputs.forge_version }}
3838
- name: Install Local Forge
39-
uses: input-output-hk/catalyst-forge/actions/install-local@ci/v1.1.0
39+
uses: input-output-hk/catalyst-forge/actions/install-local@master
4040
if: ${{ inputs.forge_version == 'local' }}
4141
with:
4242
earthly_token: ${{ secrets.earthly_token }}
@@ -51,7 +51,7 @@ jobs:
5151
echo "skip=false" >> $GITHUB_OUTPUT
5252
fi
5353
- name: Setup CI
54-
uses: input-output-hk/catalyst-forge/actions/setup@ci/v1.1.0
54+
uses: input-output-hk/catalyst-forge/actions/setup@master
5555
with:
5656
skip_earthly: ${{ steps.local.outputs.skip }}
5757
- name: Deploy

.github/workflows/docs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ jobs:
2929
steps:
3030
- uses: actions/checkout@v4
3131
- name: Install Forge
32-
uses: input-output-hk/catalyst-forge/actions/install@ci/v1.1.0
32+
uses: input-output-hk/catalyst-forge/actions/install@master
3333
if: ${{ inputs.forge_version != 'local' }}
3434
with:
3535
version: ${{ inputs.forge_version }}
3636
- name: Install Local Forge
37-
uses: input-output-hk/catalyst-forge/actions/install-local@ci/v1.1.0
37+
uses: input-output-hk/catalyst-forge/actions/install-local@master
3838
if: ${{ inputs.forge_version == 'local' }}
3939
with:
4040
earthly_token: ${{ secrets.earthly_token }}
@@ -49,12 +49,12 @@ jobs:
4949
echo "skip=false" >> $GITHUB_OUTPUT
5050
fi
5151
- name: Setup CI
52-
uses: input-output-hk/catalyst-forge/actions/setup@ci/v1.1.0
52+
uses: input-output-hk/catalyst-forge/actions/setup@master
5353
with:
5454
skip_earthly: ${{ steps.local.outputs.skip }}
5555
- name: Run
5656
id: run
57-
uses: input-output-hk/catalyst-forge/actions/run@ci/v1.1.0
57+
uses: input-output-hk/catalyst-forge/actions/run@master
5858
with:
5959
artifact: ${{ env.OUTPUT }}
6060
path: ${{ matrix.earthfile }}

.github/workflows/publish.yml

Lines changed: 0 additions & 85 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 20 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
on:
22
workflow_call:
33
inputs:
4-
earthfiles:
4+
releases:
55
description: |
6-
A JSON list of Earthfile paths+targets to use for publishing
6+
A JSON list of releases to run
77
required: true
88
type: string
9+
force:
10+
description: |
11+
Force the release to run even if no events are triggered
12+
required: false
13+
type: string
14+
default: "false"
915
forge_version:
1016
description: |
1117
The version of the forge CLI to install (use 'local' for testing)
@@ -20,21 +26,21 @@ env:
2026

2127
jobs:
2228
run:
23-
name: ${{ matrix.earthfile }}
29+
name: ${{ matrix.release.project }} (${{ matrix.release.name}})
2430
runs-on: ubuntu-latest
2531
strategy:
2632
fail-fast: false
2733
matrix:
28-
earthfile: ${{ fromJson(inputs.earthfiles) }}
34+
release: ${{ fromJson(inputs.releases) }}
2935
steps:
3036
- uses: actions/checkout@v4
3137
- name: Install Forge
32-
uses: input-output-hk/catalyst-forge/actions/install@ci/v1.1.0
38+
uses: input-output-hk/catalyst-forge/actions/install@master
3339
if: ${{ inputs.forge_version != 'local' }}
3440
with:
3541
version: ${{ inputs.forge_version }}
3642
- name: Install Local Forge
37-
uses: input-output-hk/catalyst-forge/actions/install-local@ci/v1.1.0
43+
uses: input-output-hk/catalyst-forge/actions/install-local@master
3844
if: ${{ inputs.forge_version == 'local' }}
3945
with:
4046
earthly_token: ${{ secrets.earthly_token }}
@@ -49,30 +55,15 @@ jobs:
4955
echo "skip=false" >> $GITHUB_OUTPUT
5056
fi
5157
- name: Setup CI
52-
uses: input-output-hk/catalyst-forge/actions/setup@ci/v1.1.0
58+
uses: input-output-hk/catalyst-forge/actions/setup@master
5359
with:
5460
skip_earthly: ${{ steps.local.outputs.skip }}
5561
- name: Run
56-
id: run
57-
uses: input-output-hk/catalyst-forge/actions/run@ci/v1.1.0
58-
with:
59-
artifact: ${{ env.OUTPUT }}
60-
path: ${{ matrix.earthfile }}
61-
env:
62-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63-
- name: Parse Earthfile reference
64-
id: parse
6562
run: |
66-
EARTHFILE='${{ matrix.earthfile }}'
67-
PROJECT="${EARTHFILE%+*}"
68-
TARGET="${EARTHFILE#*+}"
69-
70-
echo "project=$PROJECT" >> $GITHUB_OUTPUT
71-
echo "target=$TARGET" >> $GITHUB_OUTPUT
72-
- name: Release
73-
uses: input-output-hk/catalyst-forge/actions/release@ci/v1.1.0
74-
with:
75-
native_platform: linux/amd64
76-
path: ${{ env.OUTPUT }}
77-
project: ${{ steps.parse.outputs.project }}
78-
target: ${{ steps.parse.outputs.target }}
63+
if [[ ${{ inputs.force }} == "true" ]]; then
64+
forge -vv release --force ${{ matrix.release.project }} ${{ matrix.release.name }}
65+
else
66+
forge -vv release ${{ matrix.release.project }} ${{ matrix.release.name }}
67+
fi
68+
env:
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/run.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ jobs:
2727
steps:
2828
- uses: actions/checkout@v4
2929
- name: Install Forge
30-
uses: input-output-hk/catalyst-forge/actions/install@ci/v1.1.0
30+
uses: input-output-hk/catalyst-forge/actions/install@master
3131
if: ${{ inputs.forge_version != 'local' }}
3232
with:
3333
version: ${{ inputs.forge_version }}
3434
- name: Install Local Forge
35-
uses: input-output-hk/catalyst-forge/actions/install-local@ci/v1.1.0
35+
uses: input-output-hk/catalyst-forge/actions/install-local@master
3636
if: ${{ inputs.forge_version == 'local' }}
3737
with:
3838
earthly_token: ${{ secrets.earthly_token }}
@@ -47,11 +47,11 @@ jobs:
4747
echo "skip=false" >> $GITHUB_OUTPUT
4848
fi
4949
- name: Setup CI
50-
uses: input-output-hk/catalyst-forge/actions/setup@ci/v1.1.0
50+
uses: input-output-hk/catalyst-forge/actions/setup@master
5151
with:
5252
skip_earthly: ${{ steps.local.outputs.skip }}
5353
- name: Run
54-
uses: input-output-hk/catalyst-forge/actions/run@ci/v1.1.0
54+
uses: input-output-hk/catalyst-forge/actions/run@master
5555
with:
5656
path: ${{ matrix.earthfile }}
5757
env:

0 commit comments

Comments
 (0)