Skip to content

Commit

Permalink
Update version to v2 (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
yahavi authored Sep 12, 2021
1 parent 6868455 commit dc5aa4f
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Update v1 tag
run: git tag -f v1
- name: Update v2 tag

This comment has been minimized.

Copy link
@SATOSHI66

SATOSHI66 Oct 23, 2021

jason

run: git tag -f v2
- name: Push changes
uses: ad-m/github-push-action@master
with:
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ All build related operations will be automatically recorded with the *Workflow N
## General

```yml
- uses: jfrog/setup-jfrog-cli@v1
- uses: jfrog/setup-jfrog-cli@v2
- run: jfrog --version
```
Expand All @@ -32,7 +32,7 @@ To use the saved Artifactory server configuration in the workflow, all you need
The secret should be exposed as an environment variable with the *JF_ARTIFACTORY_* prefix.
Here's how you do this:
```yml
- uses: jfrog/setup-jfrog-cli@v1
- uses: jfrog/setup-jfrog-cli@v2
env:
JF_ARTIFACTORY_1: ${{ secrets.JF_ARTIFACTORY_SECRET_1 }}
- run: |
Expand All @@ -44,7 +44,7 @@ as the *JF_ARTIFACTORY_1* environment variable. That's it - the ping command wil

If you have multiple Artifactory servers configured as secrets, you can use all of the in the workflow as follows:
```yml
- uses: jfrog/setup-jfrog-cli@v1
- uses: jfrog/setup-jfrog-cli@v2
env:
JF_ARTIFACTORY_1: ${{ secrets.JF_ARTIFACTORY_SECRET_1 }}
JF_ARTIFACTORY_2: ${{ secrets.JF_ARTIFACTORY_SECRET_2 }}
Expand Down Expand Up @@ -79,7 +79,7 @@ are registered as the build artifacts.
By default the JFrog CLI version set in [action.yml](https://github.com/jfrog/setup-jfrog-cli/blob/master/action.yml) is used. To set a specific version, add the *version* input as follows:

```yml
- uses: jfrog/setup-jfrog-cli@v1
- uses: jfrog/setup-jfrog-cli@v2
with:
version: X.Y.Z
```
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ author: 'JFrog'
inputs:
version:
description: 'JFrog CLI Version'
default: '1.51.1'
default: '2.3.0'
required: false
runs:
using: 'node12'
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "setup-jfrog-cli",
"version": "1.2.1",
"version": "2.0.0",
"private": true,
"description": "Setup JFrog CLI in GitHub Actions",
"main": "lib/main.js",
Expand Down
26 changes: 25 additions & 1 deletion test/main.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('JFrog CLI action Tests', () => {
expect(serverTokens).toStrictEqual(['DUMMY_SERVER_TOKEN_1', 'DUMMY_SERVER_TOKEN_2']);
});

describe('JFrog CLI URL Tests', () => {
describe('JFrog CLI V1 URL Tests', () => {
const myOs: jest.Mocked<typeof os> = os as any;
let cases: string[][] = [
[
Expand All @@ -44,6 +44,30 @@ describe('JFrog CLI action Tests', () => {
});
});

describe('JFrog CLI V2 URL Tests', () => {
const myOs: jest.Mocked<typeof os> = os as any;
let cases: string[][] = [
[
'win32' as NodeJS.Platform,
'amd64',
'jfrog.exe',
'https://releases.jfrog.io/artifactory/jfrog-cli/v2/2.3.4/jfrog-cli-windows-amd64/jfrog.exe',
],
['darwin' as NodeJS.Platform, 'amd64', 'jfrog', 'https://releases.jfrog.io/artifactory/jfrog-cli/v2/2.3.4/jfrog-cli-mac-386/jfrog'],
['linux' as NodeJS.Platform, 'amd64', 'jfrog', 'https://releases.jfrog.io/artifactory/jfrog-cli/v2/2.3.4/jfrog-cli-linux-amd64/jfrog'],
['linux' as NodeJS.Platform, 'arm64', 'jfrog', 'https://releases.jfrog.io/artifactory/jfrog-cli/v2/2.3.4/jfrog-cli-linux-arm64/jfrog'],
['linux' as NodeJS.Platform, '386', 'jfrog', 'https://releases.jfrog.io/artifactory/jfrog-cli/v2/2.3.4/jfrog-cli-linux-386/jfrog'],
['linux' as NodeJS.Platform, 'arm', 'jfrog', 'https://releases.jfrog.io/artifactory/jfrog-cli/v2/2.3.4/jfrog-cli-linux-arm/jfrog'],
];

test.each(cases)('CLI Url for %s-%s', (platform, arch, fileName, expectedUrl) => {
myOs.platform.mockImplementation(() => <NodeJS.Platform>platform);
myOs.arch.mockImplementation(() => arch);
let cliUrl: string = Utils.getCliUrl('2.3.4', fileName);
expect(cliUrl).toBe(expectedUrl);
});
});

test('User agent', () => {
let userAgent: string = Utils.USER_AGENT;
let split: string[] = userAgent.split('/');
Expand Down

0 comments on commit dc5aa4f

Please sign in to comment.