Compare commits

...

60 Commits
v1.1.0 ... main

Author SHA1 Message Date
dependabot[bot] 10970da34b
chore(deps): Bump @types/node from 24.0.13 to 24.0.15 () 2025-07-21 06:27:14 +00:00
dependabot[bot] ef15fbb574
chore(deps): Bump @types/node from 24.0.7 to 24.0.13 () 2025-07-14 07:08:56 +00:00
dependabot[bot] 1144ed9a89
chore(deps): Bump @types/node from 24.0.3 to 24.0.7 () 2025-06-30 08:43:33 +00:00
dependabot[bot] 5ec3cf7c97
chore(deps): Bump @types/node from 24.0.1 to 24.0.3 () 2025-06-23 08:30:34 +00:00
dependabot[bot] da4543d3d8
chore(deps): Bump @types/node from 22.15.30 to 24.0.1 () 2025-06-16 06:23:14 +00:00
dependabot[bot] 9709f9c54b
chore(deps): Bump @types/node from 22.15.29 to 22.15.30 () 2025-06-09 05:46:58 +00:00
dependabot[bot] e56adee086
chore(deps): Bump @types/node from 22.15.21 to 22.15.29 () 2025-06-03 02:59:18 +00:00
dependabot[bot] d405705e2d
chore(deps): Bump @types/node from 22.15.19 to 22.15.21 () 2025-05-26 06:49:03 +00:00
dependabot[bot] 243302550d
chore(deps): Bump @types/node from 22.15.17 to 22.15.19 () 2025-05-19 05:34:48 +00:00
dependabot[bot] efb21e60c5
chore(deps): Bump @types/node from 22.15.2 to 22.15.17 () 2025-05-12 05:46:28 +00:00
Xiaoxuan Wang 8d34698a59
bump: add oras v1.2.3 to setup-oras ()
Signed-off-by: Xiaoxuan Wang <xiaoxuanwang@microsoft.com>
Co-authored-by: Xiaoxuan Wang <xiaoxuanwang@microsoft.com>
2025-04-29 15:54:02 +08:00
dependabot[bot] 31162f5147
chore(deps): Bump @types/node from 22.14.1 to 22.15.2 () 2025-04-29 07:32:39 +00:00
dependabot[bot] d504d0ced7
chore(deps): Bump @types/node from 22.14.0 to 22.14.1 () 2025-04-14 06:43:51 +00:00
dependabot[bot] 08dfc41cea
chore(deps): Bump @types/node from 22.13.14 to 22.14.0 () 2025-04-07 08:42:57 +00:00
dependabot[bot] 2a0fcbb0df
chore(deps): Bump typescript from 5.8.2 to 5.8.3 () 2025-04-07 08:39:57 +00:00
dependabot[bot] 85b6bd491f
chore(deps): Bump @types/node from 22.13.11 to 22.13.14 () 2025-03-31 08:33:53 +00:00
Shiwei Zhang 6f43cc3bc0
docs: add Xiaoxuan Wang as a maintainer ()
Nominate Xiaoxuan Wang (@wangxiaoxuan273) as a maintainer of the
`setup-oras` repository.

Xiaoxuan has contributed and merged `6` PRs in the past year. Since
Xiaoxuan is an active contributor of the `oras` repository, she will
update the `setup-oras` in a quicker way when there is a new `oras` CLI
release.

Signed-off-by: Shiwei Zhang <shizh@microsoft.com>
Co-authored-by: Sajay Antony <sajaya@microsoft.com>
2025-03-25 13:03:49 -07:00
dependabot[bot] c1414ef372
chore(deps): Bump @types/node from 22.13.8 to 22.13.11 () 2025-03-24 05:58:15 +00:00
dependabot[bot] 236fe1a327
chore(deps): Bump typescript from 5.7.3 to 5.8.2 () 2025-03-03 05:45:26 +00:00
dependabot[bot] 51ba51656c
chore(deps): Bump @types/node from 22.13.5 to 22.13.8 () 2025-03-03 05:41:34 +00:00
dependabot[bot] 885b2f245f
chore(deps): Bump @types/node from 22.13.4 to 22.13.5 () 2025-02-24 05:21:16 +00:00
dependabot[bot] 49b2301e62
chore(deps): Bump @types/node from 22.13.1 to 22.13.4 () 2025-02-17 06:07:22 +00:00
dependabot[bot] 8dedf0b502
chore(deps): Bump apache/skywalking-eyes from 0.6.0 to 0.7.0 () 2025-02-10 07:43:03 +00:00
dependabot[bot] f73e87bea7
chore(deps): Bump @types/node from 22.13.0 to 22.13.1 () 2025-02-10 07:37:50 +00:00
dependabot[bot] 5b37ded3aa
chore(deps): Bump @types/node from 22.10.10 to 22.13.0 () 2025-02-03 14:17:54 +00:00
dependabot[bot] 8752342f43
chore(deps): Bump @types/node from 22.10.7 to 22.10.10 () 2025-01-27 05:44:49 +00:00
Xiaoxuan Wang 5c0b487ce3
bump: add oras v1.2.1, v1.2.2 to setup-oras ()
Add v1.2.1 and v1.2.2 to setup-oras

---------

Signed-off-by: Xiaoxuan Wang <xiaoxuanwang@microsoft.com>
2025-01-20 17:01:44 +08:00
Xiaoxuan Wang 0c0dc1900f
chore(deps): bump @actions/tool-cache from 2.0.1 to 2.0.2 ()
Bumps
[@actions/tool-cache](https://github.com/actions/toolkit/tree/HEAD/packages/tool-cache)
from 2.0.1 to 2.0.2.

Should fix PR 

Signed-off-by: Xiaoxuan Wang <xiaoxuanwang@microsoft.com>
Co-authored-by: Xiaoxuan Wang <xiaoxuanwang@microsoft.com>
2025-01-20 15:52:46 +08:00
dependabot[bot] 2c7a262ecc
chore(deps): Bump @types/node from 22.10.5 to 22.10.7 () 2025-01-20 05:37:52 +00:00
dependabot[bot] b8b9ac56f5
chore(deps): Bump typescript from 5.7.2 to 5.7.3 () 2025-01-13 06:27:41 +00:00
Xiaoxuan Wang 32b3f790dd
chore(deps): Bump typescript from 5.6.3 to 5.7.2 ()
Updating the TS version. 
Related to 

Signed-off-by: Xiaoxuan Wang <xiaoxuanwang@microsoft.com>
2025-01-07 15:01:39 +08:00
dependabot[bot] 0b60ec2198
chore(deps): Bump @types/node from 22.10.2 to 22.10.5 () 2025-01-06 05:58:41 +00:00
dependabot[bot] bb066e872d
chore(deps): Bump @vercel/ncc from 0.38.2 to 0.38.3 () 2024-12-16 05:17:43 +00:00
dependabot[bot] 2fb430be3b
chore(deps): Bump @types/node from 22.7.7 to 22.10.2 () 2024-12-16 05:14:47 +00:00
Billy Zha 9c92598691
chore(deps): bump @actions/core and @vercel/ncc ()
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
2024-10-21 14:36:22 +08:00
Magnus Kulke 2a4cd09fbf
fix: s390x architecture is not handled ()
The project releases s390x binaries (64bit), but not s390 (31bit). Node
reports a s390x runner correctly as "s390x", so instllations will fail
on this platform.

https://nodejs.org/api/os.html#osarch

Hence the s390 arch case has been changed to the s390x.

Signed-off-by: Magnus Kulke <magnuskulke@microsoft.com>
2024-10-21 13:54:33 +08:00
dependabot[bot] c730dd06ba
chore(deps): Bump @types/node from 22.7.4 to 22.7.7 () 2024-10-21 05:53:03 +00:00
dependabot[bot] cf060eaf63
chore(deps): Bump typescript from 5.6.2 to 5.6.3 () 2024-10-21 05:50:13 +00:00
dependabot[bot] 4e826cc60c
chore(deps): Bump @types/node from 22.5.4 to 22.7.4 () 2024-09-30 05:42:44 +00:00
dependabot[bot] 92224c3123
chore(deps): Bump typescript from 5.5.4 to 5.6.2 () 2024-09-30 05:40:01 +00:00
dependabot[bot] 93dca0a6a3
chore(deps): Bump @types/node from 22.5.2 to 22.5.4 () 2024-09-09 08:19:35 +00:00
dependabot[bot] fb3244eae8
chore(deps): Bump @types/node from 22.5.0 to 22.5.2 () 2024-09-02 07:18:59 +00:00
dependabot[bot] d88f0eb206
chore(deps): Bump @types/node from 22.0.0 to 22.5.0 () 2024-08-26 07:32:42 +00:00
dependabot[bot] 64c9cc4fd0
chore(deps): Bump typescript from 5.5.3 to 5.5.4 () 2024-07-29 05:52:53 +00:00
dependabot[bot] 0a21717724
chore(deps): Bump @types/node from 20.14.11 to 22.0.0 () 2024-07-29 05:50:15 +00:00
dependabot[bot] 40f5205a9f
chore(deps): Bump @types/node from 20.14.10 to 20.14.11 () 2024-07-22 05:55:35 +00:00
Victor Adossi ("vados") 7b1dc67a98
chore: update README CLI docs website ()
Signed-off-by: Victor Adossi ("vados") <vados@vadosware.io>
2024-07-17 22:44:02 +08:00
dependabot[bot] 48a5fd481e
chore(deps): Bump @types/node from 20.14.9 to 20.14.10 () 2024-07-16 05:52:29 +00:00
Billy Zha 03c94b448c
chore(deps): Bump ()
Bumps @actions/core from 1.10.0 to 1.10.1 and typescript from 5.2.2 to
5.5.3.

Closes , closes .

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-05 15:10:26 +08:00
Billy Zha ebab43aab8
build(ci): make dependabot run weekly ()
It's non-trivial to check-in build changes in npm dependencies bump PRs.
Make dependabot run weekly and will manually check in such changes.

---------

Signed-off-by: Billy Zha <jinzha1@microsoft.com>
2024-07-05 15:08:30 +08:00
dependabot[bot] a51157d919
chore(deps): Bump @types/node from 20.5.9 to 20.14.9 () 2024-07-04 09:21:28 +00:00
dependabot[bot] 35937294b7
chore(deps): Bump actions/checkout from 3 to 4 () 2024-07-04 09:19:13 +00:00
dependabot[bot] 3afb69e9c5
chore(deps): Bump apache/skywalking-eyes from 0.4.0 to 0.6.0 () 2024-07-04 09:12:30 +00:00
dependabot[bot] e42b3f08b5
chore(deps): Bump actions/setup-node from 3 to 4 () 2024-07-04 09:10:35 +00:00
dependabot[bot] 50aeb9fec2
chore(deps): Bump @vercel/ncc from 0.36.1 to 0.38.1 () 2024-07-04 09:07:49 +00:00
Billy Zha 7a1ed682b5
build(ci): enable dependabot ()
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
2024-07-04 15:02:45 +08:00
Xiaoxuan Wang ca28077386
chore: update README to add an example ()
Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.com>
2024-06-06 16:31:33 +08:00
Xiaoxuan Wang 339758d383
bump: add oras v1.2.0 to setup-oras ()
Resolves 

---------

Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.com>
2024-06-06 11:29:24 +08:00
Xiaoxuan Wang e7fdc53992
feat: support downloading from customized url ()
resolves 

---------

Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.com>
2024-06-05 14:57:15 +08:00
Lan bdadd7db88
bump: run with node20 ()
Node.js 16 actions are deprecated. Please update the following actions
to use Node.js 20: oras-project/setup-oras@v1.1.0. For more information
see:
https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.

Fixes 

Signed-off-by: Lan Liang <gcslyp@gmail.com>
2024-03-26 14:46:26 +08:00
14 changed files with 867 additions and 1034 deletions

30
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,30 @@
# Copyright The ORAS Authors.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
version: 2
updates:
- package-ecosystem: "github-actions"
# Workflow files stored in the
# default location of `.github/workflows`
directory: "/"
schedule:
interval: "weekly"
labels:
- "dependencies"
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
labels:
- "dependencies"

View File

@ -26,11 +26,11 @@ jobs:
check-dist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: remove js files in dist/
run: find dist/ -type f \( -name "*.json" -o -name "*.js" -o -name "*.js.map" \) -delete
- name: Setup Node 16.x
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16.x
cache: npm

View File

@ -32,13 +32,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Check license header
uses: apache/skywalking-eyes/header@v0.4.0
uses: apache/skywalking-eyes/header@v0.7.0
with:
mode: check
config: .github/licenserc.yml
- name: Check dependencies license
uses: apache/skywalking-eyes/dependency@v0.4.0
uses: apache/skywalking-eyes/dependency@v0.7.0
with:
config: .github/licenserc.yml

View File

@ -28,19 +28,19 @@ defaults:
shell: bash
jobs:
test:
test-basic-setup:
name: Test Setup ORAS CLI
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
version:
- 1.0.1
- 1.1.0
- 1.2.3
fail-fast: true
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup ORAS v${{ matrix.version }}
uses: ./
@ -56,3 +56,81 @@ jobs:
echo ---
read -ra ORAS_VERSION_INSTALLED <<<$(oras version)
[ "${ORAS_VERSION_INSTALLED[1]}" == "$ORAS_VERSION_EXPECTED" ]
create-test-variables:
runs-on: ubuntu-latest
outputs:
url: ${{ steps.get-checksum-url.outputs.URL }}
checksum: ${{ steps.get-checksum-url.outputs.CHECKSUM }}
steps:
- id: checkout
uses: actions/checkout@v4
- id: get-checksum-url
run: |
RELEASE=$(jq -r 'keys_unsorted[0] as $k | .[$k].linux.amd64' src/lib/data/releases.json)
echo "CHECKSUM=$(echo $RELEASE | jq -r '.checksum')" >> "$GITHUB_OUTPUT"
echo "URL=$(echo $RELEASE | jq -r '.url')" >> "$GITHUB_OUTPUT"
test-custom-url:
name: Test Setup using URL
runs-on: ubuntu-latest
needs: create-test-variables
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup ORAS using URL
uses: ./
with:
url: ${{ needs.create-test-variables.outputs.url }}
checksum: ${{ needs.create-test-variables.outputs.checksum }}
- name: Setup ORAS using URL without checksum
id: no-checksum
continue-on-error: true
uses: ./
with:
url: ${{ needs.create-test-variables.outputs.url }}
- name: 'Should Fail: Setup ORAS using URL without checksum'
if: steps.no-checksum.outcome != 'failure'
run: |
echo "Setup ORAS using URL without checksum should fail, but succeeded."
exit 1
- name: Setup ORAS using checksum without url
id: no-url
continue-on-error: true
uses: ./
with:
checksum: ${{ needs.create-test-variables.outputs.checksum }}
- name: 'Should Fail: Setup ORAS using checksum without url'
if: steps.no-url.outcome != 'failure'
run: |
echo "Setup ORAS using checksum without url should fail, but succeeded."
exit 1
- name: Setup ORAS using URL and invalid checksum
id: invalid-checksum
continue-on-error: true
uses: ./
with:
url: ${{ needs.create-test-variables.outputs.url }}
checksum: abcedf
- name: 'Should Fail: Setup ORAS using URL and invalid checksum'
if: steps.invalid-checksum.outcome != 'failure'
run: |
echo "Setup ORAS using URL and invalid checksum should fail, but succeeded."
exit 1
- name: Setup ORAS using invalid URL
id: invalid-url
continue-on-error: true
uses: ./
with:
url: invalid-url
checksum: test
- name: 'Should Fail: Setup ORAS using invalid URL'
if: steps.invalid-url.outcome != 'failure'
run: |
echo "Setup ORAS using invalid URL should fail, but succeeded."
exit 1

View File

@ -1,2 +1,2 @@
# Derived from OWNERS.md
* @shizhMSFT
* @shizhMSFT @wangxiaoxuan273

6
MAINTAINERS.md Normal file
View File

@ -0,0 +1,6 @@
# Maintainers
Maintainers:
- Xiaoxuan Wang (@wangxiaoxuan273)
[Owners](OWNERS.md) are also maintainers.

View File

@ -18,8 +18,7 @@ steps:
## Advanced Usage
Install a specific version of the `oras` CLI by specifying the input `version` without the prefix `v`.
Supported versions can be found at [`oras` releases](https://github.com/oras-project/oras/releases).
Install a specific version of the `oras` CLI by specifying the input `version` without the prefix `v`. Stable versions (not pre-release versions) are supported and can be found at [`oras` releases](https://github.com/oras-project/oras/releases).
For example, install `oras` version `v1.0.0`.
@ -31,10 +30,24 @@ steps:
- run: oras version
```
You can also download `oras` CLI from any preferred trusted source, by specifying link of the source via `url` and the SHA256 checksum via `checksum`. This can be used to download a pre-release version or download from a proxy other than `github.com`.
For example, install `oras` version `v1.2.0-beta.1`.
```yaml
steps:
- uses: oras-project/setup-oras@v1
with:
url: https://github.com/oras-project/oras/releases/download/v1.2.0-beta.1/oras_1.2.0-beta.1_linux_amd64.tar.gz
checksum: 37d86f848f7c7c471035cf8218f06372fd72a9fbdca1e10f509738e222b3b2be
- run: oras version
```
## Docs
Documentation for the ORAS CLI is located on
the [project website](https://oras.land/docs/category/cli).
Documentation for the ORAS CLI is located on the [project website][docs-cli].
[docs-cli]: https://oras.land/docs/commands/use_oras_cli
## Code of Conduct

View File

@ -18,9 +18,15 @@ branding:
color: blue
inputs:
version:
description: Version of ORAS CLI to install
description: Version of the official ORAS CLI to install
required: false
default: 1.2.3
url:
description: URL of the customized ORAS CLI to install. Required if 'checksum' is present.
required: false
checksum:
description: SHA256 of the customized ORAS CLI. Required if 'url' is present.
required: false
default: 1.1.0
runs:
using: node16
main: dist/index.js
using: node20
main: dist/index.js

1350
dist/index.js vendored

File diff suppressed because one or more lines are too long

125
package-lock.json generated
View File

@ -1,88 +1,115 @@
{
"name": "setup-oras",
"version": "0.1.0",
"lockfileVersion": 1,
"lockfileVersion": 3,
"requires": true,
"dependencies": {
"@actions/core": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz",
"integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==",
"requires": {
"@actions/http-client": "^2.0.1",
"uuid": "^8.3.2"
"packages": {
"": {
"name": "setup-oras",
"version": "0.1.0",
"license": "Apache-2.0",
"dependencies": {
"@actions/core": "^1.11.1",
"@actions/tool-cache": "^2.0.2",
"@types/node": "^24.0.15",
"@vercel/ncc": "^0.38.3",
"typescript": "^5.8.3"
}
},
"@actions/exec": {
"node_modules/@actions/core": {
"version": "1.11.1",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.11.1.tgz",
"integrity": "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==",
"dependencies": {
"@actions/exec": "^1.1.1",
"@actions/http-client": "^2.0.1"
}
},
"node_modules/@actions/exec": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz",
"integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==",
"requires": {
"dependencies": {
"@actions/io": "^1.0.1"
}
},
"@actions/http-client": {
"node_modules/@actions/http-client": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.1.1.tgz",
"integrity": "sha512-qhrkRMB40bbbLo7gF+0vu+X+UawOvQQqNAA/5Unx774RS8poaOhThDOG6BGmxvAnxhQnDp2BG/ZUm65xZILTpw==",
"requires": {
"dependencies": {
"tunnel": "^0.0.6"
}
},
"@actions/io": {
"node_modules/@actions/io": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz",
"integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q=="
},
"@actions/tool-cache": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@actions/tool-cache/-/tool-cache-2.0.1.tgz",
"integrity": "sha512-iPU+mNwrbA8jodY8eyo/0S/QqCKDajiR8OxWTnSk/SnYg0sj8Hp4QcUEVC1YFpHWXtrfbQrE13Jz4k4HXJQKcA==",
"requires": {
"@actions/core": "^1.2.6",
"node_modules/@actions/tool-cache": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/@actions/tool-cache/-/tool-cache-2.0.2.tgz",
"integrity": "sha512-fBhNNOWxuoLxztQebpOaWu6WeVmuwa77Z+DxIZ1B+OYvGkGQon6kTVg6Z32Cb13WCuw0szqonK+hh03mJV7Z6w==",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.11.1",
"@actions/exec": "^1.0.0",
"@actions/http-client": "^2.0.1",
"@actions/io": "^1.1.1",
"semver": "^6.1.0",
"uuid": "^3.3.2"
},
"dependencies": {
"uuid": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A=="
}
"semver": "^6.1.0"
}
},
"@types/node": {
"version": "20.5.9",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.5.9.tgz",
"integrity": "sha512-PcGNd//40kHAS3sTlzKB9C9XL4K0sTup8nbG5lC14kzEteTNuAFh9u5nA0o5TWnSG2r/JNPRXFVcHJIIeRlmqQ=="
"node_modules/@types/node": {
"version": "24.0.15",
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.0.15.tgz",
"integrity": "sha512-oaeTSbCef7U/z7rDeJA138xpG3NuKc64/rZ2qmUFkFJmnMsAPaluIifqyWd8hSSMxyP9oie3dLAqYPblag9KgA==",
"license": "MIT",
"dependencies": {
"undici-types": "~7.8.0"
}
},
"@vercel/ncc": {
"version": "0.36.1",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.36.1.tgz",
"integrity": "sha512-S4cL7Taa9yb5qbv+6wLgiKVZ03Qfkc4jGRuiUQMQ8HGBD5pcNRnHeYM33zBvJE4/zJGjJJ8GScB+WmTsn9mORw=="
"node_modules/@vercel/ncc": {
"version": "0.38.3",
"resolved": "https://registry.npmjs.org/@vercel/ncc/-/ncc-0.38.3.tgz",
"integrity": "sha512-rnK6hJBS6mwc+Bkab+PGPs9OiS0i/3kdTO+CkI8V0/VrW3vmz7O2Pxjw/owOlmo6PKEIxRSeZKv/kuL9itnpYA==",
"bin": {
"ncc": "dist/ncc/cli.js"
}
},
"semver": {
"node_modules/semver": {
"version": "6.3.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
"bin": {
"semver": "bin/semver.js"
}
},
"tunnel": {
"node_modules/tunnel": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",
"integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg=="
"integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==",
"engines": {
"node": ">=0.6.11 <=0.7.0 || >=0.7.3"
}
},
"typescript": {
"version": "5.2.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz",
"integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w=="
"node_modules/typescript": {
"version": "5.8.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz",
"integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==",
"license": "Apache-2.0",
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=14.17"
}
},
"uuid": {
"version": "8.3.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
"node_modules/undici-types": {
"version": "7.8.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.8.0.tgz",
"integrity": "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==",
"license": "MIT"
}
}
}

View File

@ -17,10 +17,10 @@
},
"homepage": "https://github.com/oras-project/setup-oras#readme",
"dependencies": {
"@actions/core": "^1.10.0",
"@actions/tool-cache": "^2.0.1",
"@types/node": "^20.4.0",
"@vercel/ncc": "^0.36.1",
"typescript": "^5.2.2"
"@actions/core": "^1.11.1",
"@actions/tool-cache": "^2.0.2",
"@types/node": "^24.0.15",
"@vercel/ncc": "^0.38.3",
"typescript": "^5.8.3"
}
}

View File

@ -106,5 +106,205 @@
"url": "https://github.com/oras-project/oras/releases/download/v1.1.0/oras_1.1.0_windows_amd64.zip"
}
}
},
"1.2.0": {
"darwin": {
"amd64": {
"checksum": "58a8494f5bce778e21d89d90c82e05bd128e7bb9d84dd190d154f8afdbf30541",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.0/oras_1.2.0_darwin_amd64.tar.gz"
},
"arm64": {
"checksum": "fea801b0e02c5342e749ef2860e1faebae03e93ae50e33ed40d227e089cf9435",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.0/oras_1.2.0_darwin_arm64.tar.gz"
}
},
"freebsd": {
"amd64": {
"checksum": "73d3a292dce1f0985df084ff50b38ab2deacbcb01902ceebc008d5bea2f2dee9",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.0/oras_1.2.0_freebsd_amd64.tar.gz"
}
},
"linux": {
"amd64": {
"checksum": "5b3f1cbb86d869eee68120b9b45b9be983f3738442f87ee5f06b00edd0bab336",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.0/oras_1.2.0_linux_amd64.tar.gz"
},
"arm64": {
"checksum": "27df680a39fc2fcedc549cb737891623bc696c9a92a03fd341e9356a35836bae",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.0/oras_1.2.0_linux_arm64.tar.gz"
},
"armv7": {
"checksum": "054685703cb0c66e51f8143e3bbd3976e217d3d595f0593db43b6dd451e43329",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.0/oras_1.2.0_linux_armv7.tar.gz"
},
"ppc64le": {
"checksum": "af5ee50434c7263b1460978af83e7690570e8999678fae9db6c5dbb38467fed5",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.0/oras_1.2.0_linux_ppc64le.tar.gz"
},
"riscv64": {
"checksum": "42c7e5f35b72492dd3ee7c68edad0c0da939b39e6ead7f682329015b283e96f8",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.0/oras_1.2.0_linux_riscv64.tar.gz"
},
"s390x": {
"checksum": "69d2e842e592f4d990b33d58ff3c298c4e4c0921dd54ad9e65e3b6dd9427a750",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.0/oras_1.2.0_linux_s390x.tar.gz"
}
},
"windows": {
"amd64": {
"checksum": "f110b42a20bd4728fb0428d36ee6ed10de58cd986bba8e95ecc4f0272cb017ba",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.0/oras_1.2.0_windows_amd64.zip"
}
}
},
"1.2.1": {
"darwin": {
"amd64": {
"checksum": "54095db9a4cb0f37bf7ac5afbed0ff167215195ad07b6d9318b69c5a8944b19d",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.1/oras_1.2.1_darwin_amd64.tar.gz"
},
"arm64": {
"checksum": "e3489c1946cb98c21992e09f2ec37974ad3856bb88b798682975fce7960f08fe",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.1/oras_1.2.1_darwin_arm64.tar.gz"
}
},
"freebsd": {
"amd64": {
"checksum": "778f92a8d678b45a3fc70234573cf6b48f50744111f2c4c615fd9962b41481e7",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.1/oras_1.2.1_freebsd_amd64.tar.gz"
}
},
"linux": {
"amd64": {
"checksum": "4180b940409ab801ada54cdb793dd7372be2a5cb25b6522490409d5d4b0e3dde",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.1/oras_1.2.1_linux_amd64.tar.gz"
},
"arm64": {
"checksum": "65f9197e9eacda769b1f2f447e2c4004a8f3f772855c2c987d5111e8302cbbed",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.1/oras_1.2.1_linux_arm64.tar.gz"
},
"armv7": {
"checksum": "fe833e216c72f98d1426da3b0dd136328a578c92a6cd10987374bc5680c0a0a4",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.1/oras_1.2.1_linux_armv7.tar.gz"
},
"ppc64le": {
"checksum": "cbfc9b4c847becb0dc5b6f30b3bf55884a1090f5deb6894ba5183f6e916e17e2",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.1/oras_1.2.1_linux_ppc64le.tar.gz"
},
"riscv64": {
"checksum": "960067eaf16034eb8ac2f843775e53bae37b7585d55132e283fb3402a3cea68a",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.1/oras_1.2.1_linux_riscv64.tar.gz"
},
"s390x": {
"checksum": "dc3b6a4c3290c60de8c57ff63fef7a5689cd8e2df39026f2937cc25fd95dfbc4",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.1/oras_1.2.1_linux_s390x.tar.gz"
}
},
"windows": {
"amd64": {
"checksum": "e072dac29eb4a4b62520b52193e028420c159e5ec192f28bfebfb11f81c7d6d8",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.1/oras_1.2.1_windows_amd64.zip"
}
}
},
"1.2.2": {
"darwin": {
"amd64": {
"checksum": "e953c3c5580a317ba30871ee77f39a37e5bcb030edf01c5e9a83ebddcec7cf8a",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.2/oras_1.2.2_darwin_amd64.tar.gz"
},
"arm64": {
"checksum": "fcac22adaf1cfe7854738859d0f4705d1cd75a23edaef5ee2e9aba66cfff2315",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.2/oras_1.2.2_darwin_arm64.tar.gz"
}
},
"freebsd": {
"amd64": {
"checksum": "a0570a5119cb054f6d3716dd9771a2216e15bc38953293be4703059cada113e3",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.2/oras_1.2.2_freebsd_amd64.tar.gz"
}
},
"linux": {
"amd64": {
"checksum": "bff970346470e5ef888e9f2c0bf7f8ee47283f5a45207d6e7a037da1fb0eae0d",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.2/oras_1.2.2_linux_amd64.tar.gz"
},
"arm64": {
"checksum": "edd7195cbb8ba56c29ede413eefa10c8026201d63326017cd315841b4063aa56",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.2/oras_1.2.2_linux_arm64.tar.gz"
},
"armv7": {
"checksum": "df2e87741cdb703f77930a10202d4425775e69c6b925ce0cab3a2a992fa6a446",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.2/oras_1.2.2_linux_armv7.tar.gz"
},
"ppc64le": {
"checksum": "d7554f1d96061ba8c4ea8c930b01f7f47a336b20b52ac442f5dbcab88c3793cf",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.2/oras_1.2.2_linux_ppc64le.tar.gz"
},
"riscv64": {
"checksum": "dbebe747bb5f9c8382d7cdd2fb81edf48aa5d03401364252172f32caddd449eb",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.2/oras_1.2.2_linux_riscv64.tar.gz"
},
"s390x": {
"checksum": "9d72dcd93264729c9dbee91b6841fdfe1fa85ec6c9303108a889bdd6816383ee",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.2/oras_1.2.2_linux_s390x.tar.gz"
}
},
"windows": {
"amd64": {
"checksum": "25110d69d220bf55469a14c243f759305737dac6672fb47b4af4e43b000f55f5",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.2/oras_1.2.2_windows_amd64.zip"
}
}
},
"1.2.3": {
"darwin": {
"amd64": {
"checksum": "29d8b684dadd9b08614fe9023a5ac8ff0ef1bef1c9795ad8076e3215eb207724",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.3/oras_1.2.3_darwin_amd64.tar.gz"
},
"arm64": {
"checksum": "ca4188a0c690536d34baf2a4c3507b3fcc11a06979aeec6da3560a0c4d944a6a",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.3/oras_1.2.3_darwin_arm64.tar.gz"
}
},
"freebsd": {
"amd64": {
"checksum": "0cd77c9340578e4ef86533d5603498fe006f6b962d619612d49769aa01fe90e3",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.3/oras_1.2.3_freebsd_amd64.tar.gz"
}
},
"linux": {
"amd64": {
"checksum": "b4efc97a91f471f323f193ea4b4d63d8ff443ca3aab514151a30751330852827",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.3/oras_1.2.3_linux_amd64.tar.gz"
},
"arm64": {
"checksum": "90e24e234dc6dffe73365533db66fd14449d2c9ae77381081596bf92f40f6b82",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.3/oras_1.2.3_linux_arm64.tar.gz"
},
"armv7": {
"checksum": "f5d32565d714fdddc4f06fd8c00e9cc5719398ccb918a5d64a54b5531da4f893",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.3/oras_1.2.3_linux_armv7.tar.gz"
},
"ppc64le": {
"checksum": "6362e6df98961906c55fbbaf789610c575a8cd4c72a0e18a41561b36fd4352ef",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.3/oras_1.2.3_linux_ppc64le.tar.gz"
},
"riscv64": {
"checksum": "a1f2a861b5e5e295925dcdeb226a3e097e92b48c87a00c5cbbdffc6288597b37",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.3/oras_1.2.3_linux_riscv64.tar.gz"
},
"s390x": {
"checksum": "7993b9247c49e7aa3f107568c33c37d6bcae87018651a6def8278ea7c2c7a3a8",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.3/oras_1.2.3_linux_s390x.tar.gz"
}
},
"windows": {
"amd64": {
"checksum": "8fe890f5c6c89b06fb138839e533a112e0fc026a25b2c8c1b042b32455a56947",
"url": "https://github.com/oras-project/oras/releases/download/v1.2.3/oras_1.2.3_windows_amd64.zip"
}
}
}
}

View File

@ -27,7 +27,24 @@ interface releases {
}
// Get release info of a certain verion of ORAS CLI
export function getReleaseInfo(version: string) {
export function getReleaseInfo(version: string, url: string, checksum: string) {
if (url && checksum) {
// if customized ORAS CLI link and checksum are provided, version is ignored
return {
checksum: checksum,
url: url
}
}
// sanity checks
if (url && !checksum) {
throw new Error("user provided url of customized ORAS CLI release but without SHA256 checksum");
}
if (!url && checksum) {
throw new Error("user provided SHA256 checksum but without url");
}
// get the official release
const releases = releaseJson as releases;
if (!(version in releases)) {
console.log(`official ORAS CLI releases does not contain version ${version}`)
@ -54,6 +71,8 @@ export function mapPlatform(): string {
return 'darwin';
case 'win32':
return 'windows';
case 'freebsd':
return 'freebsd';
default:
throw new Error(`unsupported platform: ${platform}`);
}
@ -68,8 +87,12 @@ export function mapArch(): string {
case 'arm64':
return 'arm64';
case 'arm64':
return 'arm64';
case 's390':
return 'arm64';
case 'ppc64':
return 'ppc64le';
case 'riscv64':
return 'riscv64';
case 's390x':
return 's390x';
case 'arm':
return 'armv7';
@ -81,4 +104,4 @@ export function mapArch(): string {
export function getBinaryExtension(): string {
const platform = mapPlatform();
return platform === 'windows' ? '.exe' : '';
}
}

View File

@ -21,21 +21,23 @@ async function setup(): Promise<void> {
try {
// inputs from user
const version: string = core.getInput('version');
const url: string = core.getInput('url');
const checksum = core.getInput('checksum').toLowerCase();
// download ORAS CLI and validate checksum
const info = getReleaseInfo(version);
const url = info.url;
console.log(`downloading ORAS CLI from ${url}`);
const pathToTarball: string = await tc.downloadTool(url);
const info = getReleaseInfo(version, url, checksum);
const download_url = info.url;
console.log(`downloading ORAS CLI from ${download_url}`);
const pathToTarball: string = await tc.downloadTool(download_url);
console.log("downloading ORAS CLI completed");
const checksum = await hash(pathToTarball);
if (checksum !== info.checksum) {
throw new Error(`checksum of downloaded ORAS CLI ${checksum} does not match expected checksum ${info.checksum}`);
const actual_checksum = await hash(pathToTarball);
if (actual_checksum !== info.checksum) {
throw new Error(`checksum of downloaded ORAS CLI ${actual_checksum} does not match expected checksum ${info.checksum}`);
}
console.log("successfully verified downloaded release checksum");
// extract the tarball/zipball onto host runner
const extract = url.endsWith('.zip') ? tc.extractZip : tc.extractTar;
const extract = download_url.endsWith('.zip') ? tc.extractZip : tc.extractTar;
const pathToCLI: string = await extract(pathToTarball);
// add `ORAS` to PATH