Added support for multiple S3 object keys
This commit is contained in:
parent
8f346b53fa
commit
5346e4d0e1
40
README.md
40
README.md
|
|
@ -41,26 +41,26 @@ jobs:
|
||||||
|
|
||||||
## Inputs
|
## Inputs
|
||||||
|
|
||||||
| Name | Required | Default | Description |
|
| Name | Required | Default | Description |
|
||||||
|---|---|---|---|
|
|---|---|---|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| `working-directory` | no | `.` | Directory containing `wails.json` |
|
| `working-directory` | no | `.` | Directory containing `wails.json` |
|
||||||
| `app-name` | no | `wails.json` `name` | Override for the app name in artifact filenames |
|
| `app-name` | no | `wails.json` `name` | Override for the app name in artifact filenames |
|
||||||
| `version` | no | derived | Override; otherwise: matching semver tag → strip `v`, else 7-char short SHA |
|
| `version` | no | derived | Override; otherwise: matching semver tag → strip `v`, else 7-char short SHA |
|
||||||
| `wails-version` | no | from `go.mod` | Override the Wails CLI version |
|
| `wails-version` | no | from `go.mod` | Override the Wails CLI version |
|
||||||
| `extra-build-flags` | no | `""` | Additional flags appended to `wails build` (shell-quoted) |
|
| `extra-build-flags` | no | `""` | Additional flags appended to `wails build` (shell-quoted) |
|
||||||
| `developer-id-cert-base64` | **yes** | — | Base64-encoded Developer ID `.p12` |
|
| `developer-id-cert-base64` | **yes** | — | Base64-encoded Developer ID `.p12` |
|
||||||
| `developer-id-cert-password` | **yes** | — | `.p12` password |
|
| `developer-id-cert-password` | **yes** | — | `.p12` password |
|
||||||
| `notarization-method` | no | `auto` | `api-key`, `apple-id`, or `auto` (auto picks whichever group is fully populated) |
|
| `notarization-method` | no | `auto` | `api-key`, `apple-id`, or `auto` (auto picks whichever group is fully populated) |
|
||||||
| `notarization-api-key-base64` | conditional | — | Base64-encoded App Store Connect `.p8` |
|
| `notarization-api-key-base64` | conditional | — | Base64-encoded App Store Connect `.p8` |
|
||||||
| `notarization-api-key-id` | conditional | — | API key ID |
|
| `notarization-api-key-id` | conditional | — | API key ID |
|
||||||
| `notarization-api-issuer-id` | conditional | — | Issuer ID |
|
| `notarization-api-issuer-id` | conditional | — | Issuer ID |
|
||||||
| `notarization-apple-id` | conditional | — | Apple ID (email) |
|
| `notarization-apple-id` | conditional | — | Apple ID (email) |
|
||||||
| `notarization-apple-password` | conditional | — | App-specific password |
|
| `notarization-apple-password` | conditional | — | App-specific password |
|
||||||
| `notarization-team-id` | conditional | — | Developer Team ID |
|
| `notarization-team-id` | conditional | — | Developer Team ID |
|
||||||
| `s3-bucket` | no | — | Bucket name. If unset, upload is skipped. |
|
| `s3-bucket` | no | — | Bucket name. If unset, upload is skipped. |
|
||||||
| `s3-key` | conditional | — | Object key. Required if `s3-bucket` is set. Supports `{version}` and `{filename}` placeholders. |
|
| `s3-key` | conditional | — | Object key. Required if `s3-bucket` is set. Supports `{version}` and `{filename}` placeholders. Use commas for multiple uploads. |
|
||||||
| `s3-endpoint-url` | no | — | Custom endpoint for S3-compatible storage (MinIO, R2, etc.) |
|
| `s3-endpoint-url` | no | — | Custom endpoint for S3-compatible storage (MinIO, R2, etc.) |
|
||||||
| `s3-region` | no | `us-east-1` | AWS region |
|
| `s3-region` | no | `us-east-1` | AWS region |
|
||||||
| `s3-acl` | no | — | Canned ACL applied to the uploaded object (e.g. `public-read`). Empty = no ACL sent. Modern AWS buckets with Object Ownership = "Bucket owner enforced" reject any ACL — leave this unset for those. |
|
| `s3-acl` | no | — | Canned ACL applied to the uploaded object (e.g. `public-read`). Empty = no ACL sent. Modern AWS buckets with Object Ownership = "Bucket owner enforced" reject any ACL — leave this unset for those. |
|
||||||
|
|
||||||
AWS credentials (`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, optionally `AWS_SESSION_TOKEN`) are read from the standard environment, **not** from action inputs.
|
AWS credentials (`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, optionally `AWS_SESSION_TOKEN`) are read from the standard environment, **not** from action inputs.
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"lmika.dev/actions/wails-release/internal/actions"
|
"lmika.dev/actions/wails-release/internal/actions"
|
||||||
"lmika.dev/actions/wails-release/internal/archive"
|
"lmika.dev/actions/wails-release/internal/archive"
|
||||||
|
|
@ -167,14 +168,17 @@ func run(ctx context.Context) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
key := upload.RenderKey(cfg.S3Key, resolvedVersion, artifactName)
|
|
||||||
s3URL, err = upload.Upload(ctx, client, upload.Opts{
|
for _, keyPart := range strings.Split(cfg.S3Key, ",") {
|
||||||
Bucket: cfg.S3Bucket, Key: key, FilePath: zipPath, ACL: cfg.S3ACL,
|
key := upload.RenderKey(keyPart, resolvedVersion, artifactName)
|
||||||
})
|
s3URL, err = upload.Upload(ctx, client, upload.Opts{
|
||||||
if err != nil {
|
Bucket: cfg.S3Bucket, Key: key, FilePath: zipPath, ACL: cfg.S3ACL,
|
||||||
return err
|
})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
fmt.Println("Uploaded to:", upload.HTTPSURL(cfg.S3Bucket, key, cfg.S3Region, cfg.S3EndpointURL))
|
||||||
}
|
}
|
||||||
fmt.Println("Uploaded to:", upload.HTTPSURL(cfg.S3Bucket, key, cfg.S3Region, cfg.S3EndpointURL))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 8. Outputs (fixed order so partial-write failures are reproducible)
|
// 8. Outputs (fixed order so partial-write failures are reproducible)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue