Skip to content

Commit

Permalink
Support Artifacts API v4 (#40)
Browse files Browse the repository at this point in the history
## what
* Support Artifacts API v4
  • Loading branch information
goruha authored Feb 28, 2024
1 parent e67570a commit ed06cf3
Show file tree
Hide file tree
Showing 4,724 changed files with 1,603,402 additions and 4,320 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
12 changes: 12 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Major Release Tagger

on:
release:
types:
- published

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: cloudposse/github-action-major-release-tagger@v1
2 changes: 1 addition & 1 deletion .github/workflows/test-negative.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
continue-on-error: true
needs: [setup]
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4

- id: current
run: |-
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-positive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
continue-on-error: true
needs: [setup]
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4

- id: current
run: |-
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-reusable-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
continue-on-error: true
needs: [setup]
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4

- id: current
run: |-
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test-special-chars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,11 @@ jobs:
continue-on-error: true
needs: [setup]
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4

- id: current
run: |-
ls -la ./
echo "result=$(ls | wc -l)" >> $GITHUB_OUTPUT
outputs:
Expand Down
26 changes: 21 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,22 @@ We implement the workaround with two GitHub Actions:
* [Matrix Outputs Write](https://github.com/cloudposse/github-action-matrix-outputs-write)
* [Matrix Outputs Read](https://github.com/cloudposse/github-action-matrix-outputs-read)

## v1 - What's new

> [!IMPORTANT]
> cloudposse/github-action-matrix-outputs-write@v1+ is not currently supported on GHES yet. If you are on GHES, you
> must use [v0](https://github.com/cloudposse/github-action-matrix-outputs-write/releases/tag/0.5.0).
The release of `cloudposse/github-action-matrix-outputs-write@v1` and `cloudposse/github-action-matrix-outputs-read@v1`
are major changes to the backend architecture of Artifacts. They have numerous performance and behavioral improvements.

For more information, see the [`@actions/artifact`](https://github.com/actions/toolkit/tree/main/packages/artifact) documentation.

### Breaking Changes

1. On self hosted runners, additional [firewall rules](https://github.com/actions/toolkit/tree/main/packages/artifact#breaking-changes) may be required.
2. Outputs writen with `cloudposse/github-action-matrix-outputs-write@v1` can not be read by `cloudposse/github-action-matrix-outputs-read@v0`and below versions.




Expand Down Expand Up @@ -106,7 +122,7 @@ Example how you can use workaround to reference matrix job outputs.
PLATFORM=${{ matrix.platform }}
## Write for matrix outputs workaround
- uses: cloudposse/github-action-matrix-outputs-write@main
- uses: cloudposse/github-action-matrix-outputs-write@v1
id: out
with:
matrix-step-name: ${{ github.job }}
Expand All @@ -121,7 +137,7 @@ Example how you can use workaround to reference matrix job outputs.
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: cloudposse/github-action-matrix-outputs-read@main
- uses: cloudposse/github-action-matrix-outputs-read@v1
id: read
with:
matrix-step-name: build
Expand Down Expand Up @@ -205,7 +221,7 @@ jobs:
needs: [build]
steps:
## Write for matrix outputs workaround
- uses: cloudposse/github-action-matrix-outputs-write@main
- uses: cloudposse/github-action-matrix-outputs-write@v1
id: out
with:
matrix-step-name: ${{ inputs.matrix-step-name }}
Expand Down Expand Up @@ -246,7 +262,7 @@ jobs:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: cloudposse/github-action-matrix-outputs-read@main
- uses: cloudposse/github-action-matrix-outputs-read@v1
id: read
with:
matrix-step-name: build
Expand Down Expand Up @@ -421,7 +437,7 @@ In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow.

## Copyright

Copyright © 2017-2023 [Cloud Posse, LLC](https://cpco.io/copyright)
Copyright © 2017-2024 [Cloud Posse, LLC](https://cpco.io/copyright)



Expand Down
24 changes: 20 additions & 4 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,22 @@ introduction: |-
We implement the workaround with two GitHub Actions:
* [Matrix Outputs Write](https://github.com/cloudposse/github-action-matrix-outputs-write)
* [Matrix Outputs Read](https://github.com/cloudposse/github-action-matrix-outputs-read)
## v1 - What's new
> [!IMPORTANT]
> cloudposse/github-action-matrix-outputs-write@v1+ is not currently supported on GHES yet. If you are on GHES, you
> must use [v0](https://github.com/cloudposse/github-action-matrix-outputs-write/releases/tag/0.5.0).
The release of `cloudposse/github-action-matrix-outputs-write@v1` and `cloudposse/github-action-matrix-outputs-read@v1`
are major changes to the backend architecture of Artifacts. They have numerous performance and behavioral improvements.
For more information, see the [`@actions/artifact`](https://github.com/actions/toolkit/tree/main/packages/artifact) documentation.
### Breaking Changes
1. On self hosted runners, additional [firewall rules](https://github.com/actions/toolkit/tree/main/packages/artifact#breaking-changes) may be required.
2. Outputs writen with `cloudposse/github-action-matrix-outputs-write@v1` can not be read by `cloudposse/github-action-matrix-outputs-read@v0`and below versions.
references:
- name: "github-actions-workflows"
Expand Down Expand Up @@ -88,7 +104,7 @@ usage: |-
PLATFORM=${{ matrix.platform }}
## Write for matrix outputs workaround
- uses: cloudposse/github-action-matrix-outputs-write@main
- uses: cloudposse/github-action-matrix-outputs-write@v1
id: out
with:
matrix-step-name: ${{ github.job }}
Expand All @@ -103,7 +119,7 @@ usage: |-
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: cloudposse/github-action-matrix-outputs-read@main
- uses: cloudposse/github-action-matrix-outputs-read@v1
id: read
with:
matrix-step-name: build
Expand Down Expand Up @@ -187,7 +203,7 @@ usage: |-
needs: [build]
steps:
## Write for matrix outputs workaround
- uses: cloudposse/github-action-matrix-outputs-write@main
- uses: cloudposse/github-action-matrix-outputs-write@v1
id: out
with:
matrix-step-name: ${{ inputs.matrix-step-name }}
Expand Down Expand Up @@ -228,7 +244,7 @@ usage: |-
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: cloudposse/github-action-matrix-outputs-read@main
- uses: cloudposse/github-action-matrix-outputs-read@v1
id: read
with:
matrix-step-name: build
Expand Down
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const core = require('@actions/core');
const yaml = require('yaml')
const artifact = require('@actions/artifact');
const {DefaultArtifactClient} = require('@actions/artifact')
const crypto = require('crypto');
const fs = require('fs');

Expand Down Expand Up @@ -73,7 +73,7 @@ ${error}`;

const hex = hashSum.digest('hex');

const artifactClient = artifact.create()
const artifactClient = new DefaultArtifactClient();
const artifactName = hex;
const files = [
"./" + step_name,
Expand All @@ -84,7 +84,7 @@ ${error}`;
continueOnError: false
}

const uploadResponse = artifactClient.uploadArtifact(artifactName, files, rootDirectory, options)
artifactClient.uploadArtifact(artifactName, files, rootDirectory, options)
}
} catch (error) {
core.setFailed(error.message);
Expand Down
1 change: 1 addition & 0 deletions node_modules/.bin/crc32

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

1 change: 1 addition & 0 deletions node_modules/.bin/dot-object

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

1 change: 1 addition & 0 deletions node_modules/.bin/mkdirp

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

1 change: 1 addition & 0 deletions node_modules/.bin/prettier

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

1 change: 1 addition & 0 deletions node_modules/.bin/protoc

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

1 change: 1 addition & 0 deletions node_modules/.bin/protoc-gen-dump

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

1 change: 1 addition & 0 deletions node_modules/.bin/protoc-gen-ts

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

1 change: 1 addition & 0 deletions node_modules/.bin/protoc-gen-twirp_ts

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

1 change: 1 addition & 0 deletions node_modules/.bin/tsc

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

1 change: 1 addition & 0 deletions node_modules/.bin/tsserver

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

1 change: 1 addition & 0 deletions node_modules/.bin/yaml

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

Loading

0 comments on commit ed06cf3

Please sign in to comment.