Compare commits
60 Commits
Author | SHA1 | Date |
---|---|---|
|
10970da34b | |
|
ef15fbb574 | |
|
1144ed9a89 | |
|
5ec3cf7c97 | |
|
da4543d3d8 | |
|
9709f9c54b | |
|
e56adee086 | |
|
d405705e2d | |
|
243302550d | |
|
efb21e60c5 | |
|
8d34698a59 | |
|
31162f5147 | |
|
d504d0ced7 | |
|
08dfc41cea | |
|
2a0fcbb0df | |
|
85b6bd491f | |
|
6f43cc3bc0 | |
|
c1414ef372 | |
|
236fe1a327 | |
|
51ba51656c | |
|
885b2f245f | |
|
49b2301e62 | |
|
8dedf0b502 | |
|
f73e87bea7 | |
|
5b37ded3aa | |
|
8752342f43 | |
|
5c0b487ce3 | |
|
0c0dc1900f | |
|
2c7a262ecc | |
|
b8b9ac56f5 | |
|
32b3f790dd | |
|
0b60ec2198 | |
|
bb066e872d | |
|
2fb430be3b | |
|
9c92598691 | |
|
2a4cd09fbf | |
|
c730dd06ba | |
|
cf060eaf63 | |
|
4e826cc60c | |
|
92224c3123 | |
|
93dca0a6a3 | |
|
fb3244eae8 | |
|
d88f0eb206 | |
|
64c9cc4fd0 | |
|
0a21717724 | |
|
40f5205a9f | |
|
7b1dc67a98 | |
|
48a5fd481e | |
|
03c94b448c | |
|
ebab43aab8 | |
|
a51157d919 | |
|
35937294b7 | |
|
3afb69e9c5 | |
|
e42b3f08b5 | |
|
50aeb9fec2 | |
|
7a1ed682b5 | |
|
ca28077386 | |
|
339758d383 | |
|
e7fdc53992 | |
|
bdadd7db88 |
|
@ -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"
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
# Derived from OWNERS.md
|
||||
* @shizhMSFT
|
||||
* @shizhMSFT @wangxiaoxuan273
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
# Maintainers
|
||||
|
||||
Maintainers:
|
||||
- Xiaoxuan Wang (@wangxiaoxuan273)
|
||||
|
||||
[Owners](OWNERS.md) are also maintainers.
|
21
README.md
21
README.md
|
@ -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
|
||||
|
||||
|
|
14
action.yml
14
action.yml
|
@ -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
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
10
package.json
10
package.json
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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' : '';
|
||||
}
|
||||
}
|
||||
|
|
18
src/setup.ts
18
src/setup.ts
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue