Skip to content
Merged
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
7 changes: 7 additions & 0 deletions .craft.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
minVersion: '2.14.0'
changelog:
policy: auto
artifactProvider:
name: github
config:
artifacts:
Build & Test:
- craft-binary
- craft-docs
preReleaseCommand: >-
node -p "
const {execSync} = require('child_process');
Expand Down
32 changes: 2 additions & 30 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
- name: Upload Build Artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: ${{ github.sha }}-build
name: craft-binary
path: |
${{ github.workspace }}/*.tgz
${{ github.workspace }}/dist/craft
Expand Down Expand Up @@ -114,33 +114,5 @@ jobs:
- name: Upload Docs Artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: ${{ github.sha }}-docs
name: craft-docs
path: ${{ github.workspace }}/gh-pages.zip

merge-artifacts:
name: Merge Artifacts
needs:
- build
- docs
if: always() && needs.build.result == 'success' && needs.docs.result == 'success'
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Download Build Artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: ${{ github.sha }}-build
- name: Download Docs Artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: ${{ github.sha }}-docs
- name: Archive Merged Artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: ${{ github.sha }}
path: |
${{ github.workspace }}/*.tgz
${{ github.workspace }}/dist/craft
${{ github.workspace }}/gh-pages.zip
if-no-files-found: ignore
75 changes: 75 additions & 0 deletions docs/src/content/docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,81 @@ artifactProvider:
name: github # or 'gcs' or 'none'
```

### GitHub Artifact Provider Configuration

By default, the GitHub artifact provider looks for artifacts named exactly as the commit SHA. You can customize this with the `artifacts` configuration option.

#### Pattern Syntax

- **Regex patterns**: Wrapped in `/` (e.g., `/^build-.*$/`)
- **Exact strings**: Plain text (e.g., `build`, `release-artifacts`)

#### Configuration Formats

**1. Single artifact pattern** - searches all workflows:

```yaml
artifactProvider:
name: github
config:
artifacts: /^sentry-.*\.tgz$/
```

**2. Multiple artifact patterns** - searches all workflows:

```yaml
artifactProvider:
name: github
config:
artifacts:
- /^sentry-.*\.tgz$/
- release-bundle
```

**3. Workflow-scoped patterns** - filter by workflow name:

```yaml
artifactProvider:
name: github
config:
artifacts:
build: release-artifacts # exact workflow → exact artifact
/^build-.*$/: artifacts # workflow pattern → exact artifact
ci: # exact workflow → multiple artifacts
- /^output-.*$/
- bundle
/^release-.*$/: # workflow pattern → multiple artifacts
- /^dist-.*$/
- checksums
```

#### Common Examples

Fetch artifacts named `craft-binary` and `craft-docs` from the "Build & Test" workflow:

```yaml
artifactProvider:
name: github
config:
artifacts:
Build & Test:
- craft-binary
- craft-docs
```

Fetch all `.tgz` files from any workflow:

```yaml
artifactProvider:
name: github
config:
artifacts: /\.tgz$/
```

#### Backward Compatibility

When `artifacts` is not configured, the provider uses the legacy behavior where it searches for an artifact with a name matching the commit SHA exactly. This ensures existing configurations continue to work without changes.

## Targets

List release targets in your configuration:
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
},
"dependencies": {
"marked": "^17.0.1",
"p-limit": "^6.2.0",
"semver": "^7.7.3"
},
"pnpm": {
Expand Down
17 changes: 17 additions & 0 deletions pnpm-lock.yaml

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

Loading
Loading