Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adds release command #71

Draft
wants to merge 25 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 23 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,16 @@ jobs:
outputs:
deployments: ${{ steps.discovery.outputs.deployments }}
earthfiles: ${{ steps.discovery.outputs.earthfiles }}
releases: ${{ steps.discovery.outputs.releases }}
steps:
- uses: actions/checkout@v4
- name: Install Forge
uses: input-output-hk/catalyst-forge/actions/install@ci/v1.1.0
uses: input-output-hk/catalyst-forge/actions/install@adds-release-cm
if: ${{ inputs.forge_version != 'local' }}
with:
version: ${{ inputs.forge_version }}
- name: Install Local Forge
uses: input-output-hk/catalyst-forge/actions/install-local@ci/v1.1.0
uses: input-output-hk/catalyst-forge/actions/install-local@adds-release-cm
if: ${{ inputs.forge_version == 'local' }}
with:
earthly_token: ${{ secrets.earthly_token }}
Expand All @@ -50,14 +51,14 @@ jobs:
echo "skip=false" >> $GITHUB_OUTPUT
fi
- name: Setup CI
uses: input-output-hk/catalyst-forge/actions/setup@ci/v1.1.0
uses: input-output-hk/catalyst-forge/actions/setup@adds-release-cm
with:
skip_docker: 'true'
skip_github: 'true'
skip_earthly: ${{ steps.local.outputs.skip }}
- name: Discovery
id: discovery
uses: input-output-hk/catalyst-forge/actions/discovery@ci/v1.1.0
uses: input-output-hk/catalyst-forge/actions/discovery@adds-release-cm
with:
filters: |
${{ env.FORGE_REGEX_CHECK }}
Expand All @@ -69,7 +70,7 @@ jobs:
${{ env.FORGE_REGEX_PUBLISH }}

check:
uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@ci/v1.1.0
uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@adds-release-cm
needs: [discover]
if: (fromJson(needs.discover.outputs.earthfiles)['^check(-.*)?$'] != null) && !failure() && !cancelled()
with:
Expand All @@ -79,7 +80,7 @@ jobs:
earthly_token: ${{ secrets.earthly_token }}

build:
uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@ci/v1.1.0
uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@adds-release-cm
needs: [discover, check]
if: (fromJson(needs.discover.outputs.earthfiles)['^build(-.*)?$'] != null) && !failure() && !cancelled()
with:
Expand All @@ -89,7 +90,7 @@ jobs:
earthly_token: ${{ secrets.earthly_token }}

package:
uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@ci/v1.1.0
uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@adds-release-cm
needs: [discover, check, build]
if: (fromJson(needs.discover.outputs.earthfiles)['^package(-.*)?$'] != null) && !failure() && !cancelled()
with:
Expand All @@ -99,7 +100,7 @@ jobs:
earthly_token: ${{ secrets.earthly_token }}

test:
uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@ci/v1.1.0
uses: input-output-hk/catalyst-forge/.github/workflows/run.yml@adds-release-cm
needs: [discover, check, build, package]
if: (fromJson(needs.discover.outputs.earthfiles)['^test(-.*)?$'] != null) && !failure() && !cancelled()
with:
Expand All @@ -109,7 +110,7 @@ jobs:
earthly_token: ${{ secrets.earthly_token }}

docs:
uses: input-output-hk/catalyst-forge/.github/workflows/docs.yml@ci/v1.1.0
uses: input-output-hk/catalyst-forge/.github/workflows/docs.yml@adds-release-cm
needs: [discover, check, build, test]
if: (fromJson(needs.discover.outputs.earthfiles)['^docs(-.*)?$'] != null) && !failure() && !cancelled()
with:
Expand All @@ -119,7 +120,7 @@ jobs:
earthly_token: ${{ secrets.earthly_token }}

publish:
uses: input-output-hk/catalyst-forge/.github/workflows/publish.yml@ci/v1.1.0
uses: input-output-hk/catalyst-forge/.github/workflows/publish.yml@adds-release-cm
needs: [discover, check, build, test]
if: (fromJson(needs.discover.outputs.earthfiles)['^publish(-.*)?$'] != null) && !failure() && !cancelled()
with:
Expand All @@ -129,7 +130,7 @@ jobs:
earthly_token: ${{ secrets.earthly_token }}

deploy:
uses: input-output-hk/catalyst-forge/.github/workflows/deploy.yml@ci/v1.1.0
uses: input-output-hk/catalyst-forge/.github/workflows/deploy.yml@adds-release-cm
needs: [discover, check, build, test, publish]
if: (fromJson(needs.discover.outputs.deployments)[0] != null) && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && !failure() && !cancelled()
with:
Expand All @@ -139,7 +140,7 @@ jobs:
earthly_token: ${{ secrets.earthly_token }}

release:
uses: input-output-hk/catalyst-forge/.github/workflows/release.yml@ci/v1.1.0
uses: input-output-hk/catalyst-forge/.github/workflows/release.yml@adds-release-cm
needs: [discover, check, build, test]
if: (fromJson(needs.discover.outputs.earthfiles)['^release(-.*)?$'] != null) && !failure() && !cancelled()
with:
Expand All @@ -148,6 +149,16 @@ jobs:
secrets:
earthly_token: ${{ secrets.earthly_token }}

release_new:
uses: input-output-hk/catalyst-forge/.github/workflows/release_new.yml@adds-release-cm
needs: [discover, check, build, test]
if: (fromJson(needs.discover.outputs.releases)[0] != null) && !failure() && !cancelled()
with:
releases: ${{ needs.discover.outputs.releases }}
forge_version: ${{ inputs.forge_version }}
secrets:
earthly_token: ${{ secrets.earthly_token }}

final:
needs: [check, build, package, test, publish, release]
if: (!failure() && !cancelled())
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install Forge
uses: input-output-hk/catalyst-forge/actions/install@ci/v1.1.0
uses: input-output-hk/catalyst-forge/actions/install@adds-release-cm
if: ${{ inputs.forge_version != 'local' }}
with:
version: ${{ inputs.forge_version }}
- name: Install Local Forge
uses: input-output-hk/catalyst-forge/actions/install-local@ci/v1.1.0
uses: input-output-hk/catalyst-forge/actions/install-local@adds-release-cm
if: ${{ inputs.forge_version == 'local' }}
with:
earthly_token: ${{ secrets.earthly_token }}
Expand All @@ -51,7 +51,7 @@ jobs:
echo "skip=false" >> $GITHUB_OUTPUT
fi
- name: Setup CI
uses: input-output-hk/catalyst-forge/actions/setup@ci/v1.1.0
uses: input-output-hk/catalyst-forge/actions/setup@adds-release-cm
with:
skip_earthly: ${{ steps.local.outputs.skip }}
- name: Deploy
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install Forge
uses: input-output-hk/catalyst-forge/actions/install@ci/v1.1.0
uses: input-output-hk/catalyst-forge/actions/install@adds-release-cm
if: ${{ inputs.forge_version != 'local' }}
with:
version: ${{ inputs.forge_version }}
- name: Install Local Forge
uses: input-output-hk/catalyst-forge/actions/install-local@ci/v1.1.0
uses: input-output-hk/catalyst-forge/actions/install-local@adds-release-cm
if: ${{ inputs.forge_version == 'local' }}
with:
earthly_token: ${{ secrets.earthly_token }}
Expand All @@ -49,12 +49,12 @@ jobs:
echo "skip=false" >> $GITHUB_OUTPUT
fi
- name: Setup CI
uses: input-output-hk/catalyst-forge/actions/setup@ci/v1.1.0
uses: input-output-hk/catalyst-forge/actions/setup@adds-release-cm
with:
skip_earthly: ${{ steps.local.outputs.skip }}
- name: Run
id: run
uses: input-output-hk/catalyst-forge/actions/run@ci/v1.1.0
uses: input-output-hk/catalyst-forge/actions/run@adds-release-cm
with:
artifact: ${{ env.OUTPUT }}
path: ${{ matrix.earthfile }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install Forge
uses: input-output-hk/catalyst-forge/actions/install@ci/v1.1.0
uses: input-output-hk/catalyst-forge/actions/install@adds-release-cm
if: ${{ inputs.forge_version != 'local' }}
with:
version: ${{ inputs.forge_version }}
- name: Install Local Forge
uses: input-output-hk/catalyst-forge/actions/install-local@ci/v1.1.0
uses: input-output-hk/catalyst-forge/actions/install-local@adds-release-cm
if: ${{ inputs.forge_version == 'local' }}
with:
earthly_token: ${{ secrets.earthly_token }}
Expand All @@ -56,12 +56,12 @@ jobs:
echo "skip=false" >> $GITHUB_OUTPUT
fi
- name: Setup CI
uses: input-output-hk/catalyst-forge/actions/setup@ci/v1.1.0
uses: input-output-hk/catalyst-forge/actions/setup@adds-release-cm
with:
skip_earthly: ${{ steps.local.outputs.skip }}
- name: Run
id: run
uses: input-output-hk/catalyst-forge/actions/run@ci/v1.1.0
uses: input-output-hk/catalyst-forge/actions/run@adds-release-cm
with:
path: ${{ matrix.earthfile }}
target_args: --container ${{ env.CONTAINER }} --tag ${{ env.TAG }}
Expand All @@ -77,7 +77,7 @@ jobs:
echo "project=$PROJECT" >> $GITHUB_OUTPUT
echo "target=$TARGET" >> $GITHUB_OUTPUT
- name: Publish
uses: input-output-hk/catalyst-forge/actions/publish@ci/v1.1.0
uses: input-output-hk/catalyst-forge/actions/publish@adds-release-cm
with:
image: "${{ env.CONTAINER }}:${{ env.TAG }}"
project: ${{ steps.parse.outputs.project }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install Forge
uses: input-output-hk/catalyst-forge/actions/install@ci/v1.1.0
uses: input-output-hk/catalyst-forge/actions/install@adds-release-cm
if: ${{ inputs.forge_version != 'local' }}
with:
version: ${{ inputs.forge_version }}
- name: Install Local Forge
uses: input-output-hk/catalyst-forge/actions/install-local@ci/v1.1.0
uses: input-output-hk/catalyst-forge/actions/install-local@adds-release-cm
if: ${{ inputs.forge_version == 'local' }}
with:
earthly_token: ${{ secrets.earthly_token }}
Expand All @@ -49,12 +49,12 @@ jobs:
echo "skip=false" >> $GITHUB_OUTPUT
fi
- name: Setup CI
uses: input-output-hk/catalyst-forge/actions/setup@ci/v1.1.0
uses: input-output-hk/catalyst-forge/actions/setup@adds-release-cm
with:
skip_earthly: ${{ steps.local.outputs.skip }}
- name: Run
id: run
uses: input-output-hk/catalyst-forge/actions/run@ci/v1.1.0
uses: input-output-hk/catalyst-forge/actions/run@adds-release-cm
with:
artifact: ${{ env.OUTPUT }}
path: ${{ matrix.earthfile }}
Expand All @@ -70,7 +70,7 @@ jobs:
echo "project=$PROJECT" >> $GITHUB_OUTPUT
echo "target=$TARGET" >> $GITHUB_OUTPUT
- name: Release
uses: input-output-hk/catalyst-forge/actions/release@ci/v1.1.0
uses: input-output-hk/catalyst-forge/actions/release@adds-release-cm
with:
native_platform: linux/amd64
path: ${{ env.OUTPUT }}
Expand Down
69 changes: 69 additions & 0 deletions .github/workflows/release_new.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
on:
workflow_call:
inputs:
releases:
description: |
A JSON list of releases to run
required: true
type: string
force:
description: |
Force the release to run even if no events are triggered
required: false
type: string
default: "false"
forge_version:
description: |
The version of the forge CLI to install (use 'local' for testing)
required: true
type: string
secrets:
earthly_token:
description: Optional Earthly token used to login to Earthly cloud during local builds of Forge CLI
required: false
env:
OUTPUT: ${{ github.workspace }}/output

jobs:
run:
name: ${{ matrix.release.project }} (${{ matrix.release.name}})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
release: ${{ fromJson(inputs.releases) }}
steps:
- uses: actions/checkout@v4
- name: Install Forge
uses: input-output-hk/catalyst-forge/actions/install@adds-release-cm
if: ${{ inputs.forge_version != 'local' }}
with:
version: ${{ inputs.forge_version }}
- name: Install Local Forge
uses: input-output-hk/catalyst-forge/actions/install-local@adds-release-cm
if: ${{ inputs.forge_version == 'local' }}
with:
earthly_token: ${{ secrets.earthly_token }}
- name: Check forge version
id: local
run: |
forge version

if [[ "${{ inputs.forge_version }}" == "local" ]]; then
echo "skip=true" >> $GITHUB_OUTPUT
else
echo "skip=false" >> $GITHUB_OUTPUT
fi
- name: Setup CI
uses: input-output-hk/catalyst-forge/actions/setup@adds-release-cm
with:
skip_earthly: ${{ steps.local.outputs.skip }}
- name: Run
run: |
if [[ ${{ inputs.force }} == "true" ]]; then
forge -vv release --force ${{ matrix.release.project }} ${{ matrix.release.name }}
else
forge -vv release ${{ matrix.release.project }} ${{ matrix.release.name }}
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 4 additions & 4 deletions .github/workflows/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install Forge
uses: input-output-hk/catalyst-forge/actions/install@ci/v1.1.0
uses: input-output-hk/catalyst-forge/actions/install@adds-release-cm
if: ${{ inputs.forge_version != 'local' }}
with:
version: ${{ inputs.forge_version }}
- name: Install Local Forge
uses: input-output-hk/catalyst-forge/actions/install-local@ci/v1.1.0
uses: input-output-hk/catalyst-forge/actions/install-local@adds-release-cm
if: ${{ inputs.forge_version == 'local' }}
with:
earthly_token: ${{ secrets.earthly_token }}
Expand All @@ -47,11 +47,11 @@ jobs:
echo "skip=false" >> $GITHUB_OUTPUT
fi
- name: Setup CI
uses: input-output-hk/catalyst-forge/actions/setup@ci/v1.1.0
uses: input-output-hk/catalyst-forge/actions/setup@adds-release-cm
with:
skip_earthly: ${{ steps.local.outputs.skip }}
- name: Run
uses: input-output-hk/catalyst-forge/actions/run@ci/v1.1.0
uses: input-output-hk/catalyst-forge/actions/run@adds-release-cm
with:
path: ${{ matrix.earthfile }}
env:
Expand Down
2 changes: 2 additions & 0 deletions actions/discovery/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ outputs:
description: The deployments discovered
earthfiles:
description: The earthfiles discovered
releases:
description: The releases discovered

runs:
using: node20
Expand Down
Loading