Skip to content

Commit

Permalink
feat: migrates publish action to use forge tag command (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgilman authored Sep 10, 2024
1 parent 8845753 commit c904677
Show file tree
Hide file tree
Showing 12 changed files with 289 additions and 204 deletions.
17 changes: 16 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
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

jobs:
discover:
Expand All @@ -17,6 +21,7 @@ jobs:
- name: Setup
uses: ./forge/actions/setup
with:
earthly_token: ${{ secrets.earthly_token }}
forge_version: ${{ inputs.forge_version }}
- name: Discovery
id: discovery
Expand All @@ -35,31 +40,41 @@ jobs:
with:
earthfiles: ${{ toJson(fromJson(needs.discover.outputs.result)['^check.*']) }}
forge_version: ${{ inputs.forge_version }}
secrets:
earthly_token: ${{ secrets.earthly_token }}

build:
uses: ./.github/workflows/run.yml
needs: [discover, check]
with:
earthfiles: ${{ toJson(fromJson(needs.discover.outputs.result)['^build.*']) }}
forge_version: ${{ inputs.forge_version }}
secrets:
earthly_token: ${{ secrets.earthly_token }}

test:
uses: ./.github/workflows/run.yml
needs: [discover, check, build]
with:
earthfiles: ${{ toJson(fromJson(needs.discover.outputs.result)['^test.*']) }}
forge_version: ${{ inputs.forge_version }}
secrets:
earthly_token: ${{ secrets.earthly_token }}

publish:
uses: ./.github/workflows/publish.yml
needs: [discover, check, build, test]
with:
earthfiles: ${{ toJson(fromJson(needs.discover.outputs.result)['publish']) }}
forge_version: ${{ inputs.forge_version }}
secrets:
earthly_token: ${{ secrets.earthly_token }}

release:
uses: ./.github/workflows/release.yml
needs: [discover, check, build, test]
with:
earthfiles: ${{ toJson(fromJson(needs.discover.outputs.result)['release']) }}
forge_version: ${{ inputs.forge_version }}
forge_version: ${{ inputs.forge_version }}
secrets:
earthly_token: ${{ secrets.earthly_token }}
4 changes: 3 additions & 1 deletion .github/workflows/dogfood.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ jobs:
ci:
uses: ./.github/workflows/ci.yml
with:
forge_version: local
forge_version: local
secrets:
earthly_token: ${{ secrets.EARTHLY_TOKEN }}
5 changes: 5 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
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

jobs:
run:
Expand All @@ -25,6 +29,7 @@ jobs:
- name: Setup CI
uses: ./forge/actions/setup
with:
earthly_token: ${{ secrets.earthly_token }}
forge_version: ${{ inputs.forge_version }}
- name: Run
id: run
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ on:
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

Expand All @@ -28,6 +31,7 @@ jobs:
- name: Setup CI
uses: ./forge/actions/setup
with:
earthly_token: ${{ secrets.earthly_token }}
forge_version: ${{ inputs.forge_version }}
- name: Run
id: run
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
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

jobs:
run:
Expand All @@ -25,6 +29,7 @@ jobs:
- name: Setup CI
uses: ./forge/actions/setup
with:
earthly_token: ${{ secrets.earthly_token }}
forge_version: ${{ inputs.forge_version }}
- name: Run
uses: ./forge/actions/run
Expand Down
106 changes: 18 additions & 88 deletions forge/actions/publish/dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion forge/actions/publish/dist/index.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit c904677

Please sign in to comment.