Skip to content

Commit

Permalink
Merge pull request #279 from cdnjs/sven/revert-r2
Browse files Browse the repository at this point in the history
Revert r2 pump changes
  • Loading branch information
xtuc authored Feb 6, 2024
2 parents 7f30c03 + 5f242fa commit ce7815a
Show file tree
Hide file tree
Showing 8 changed files with 137 additions and 1,176 deletions.
10 changes: 0 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,6 @@ jobs:
asset_name: r2-pump.zip
asset_content_type: application/zip

- uses: actions/upload-release-asset@v1
name: release r2-pump-http function
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./functions/r2-pump-http/r2-pump-http.zip
asset_name: r2-pump-http.zip
asset_content_type: application/zip

- uses: actions/upload-release-asset@v1
name: release force-update function
env:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GO_BUILD_ARGS = -mod=readonly -v -ldflags="-s -w"
CLOUD_FUNCTIONS = process-version check-pkg-updates kv-pump algolia-pump force-update r2-pump r2-pump-http
CLOUD_FUNCTIONS = process-version check-pkg-updates kv-pump algolia-pump force-update r2-pump

define generate-func-make
make -C ./functions/$1 $1.zip
Expand Down
4 changes: 2 additions & 2 deletions audit/audit.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,14 @@ func WroteAlgolia(ctx context.Context, pkgName string, currVersion string, lastV
return nil
}

func WroteR2(ctx context.Context, pkgName string, version string, keys []string) error {
func WroteR2(ctx context.Context, pkgName string, version string, keys []string, ext string) error {
content := bytes.NewBufferString("")
fmt.Fprint(content, "Files:\n")
for _, key := range keys {
fmt.Fprintf(content, "- %s\n", key)
}

if err := create(ctx, pkgName, version, "r2-publish", content); err != nil {
if err := create(ctx, pkgName, version, "r2-publish/"+ext, content); err != nil {
return errors.Wrap(err, "could not create audit log file")
}
return nil
Expand Down
4 changes: 0 additions & 4 deletions functions/r2-pump-http/Makefile

This file was deleted.

60 changes: 0 additions & 60 deletions functions/r2-pump-http/go.mod

This file was deleted.

Loading

0 comments on commit ce7815a

Please sign in to comment.