Skip to content

Commit

Permalink
Adds support for OrgFlow v2 (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
paynecrl97 authored Mar 1, 2023
1 parent 2a4aeaf commit 48a3f5b
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install
run: |
npm i -g @vercel/ncc
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

setup_job:
runs-on: ubuntu-latest
container: orgflow/cli:1.4.x
container: orgflow/cli:2.x
name: Setup
outputs:
stack-name: ${{ steps.create_stack.outputs.stack-name }}
Expand All @@ -22,8 +22,8 @@ jobs:
run: |
mkdir /tmp/$STACKNAME
git init --bare -b main /tmp/$STACKNAME
orgflow stack:create --name=$STACKNAME --gitRepoUrl=/tmp/$STACKNAME --username=${{ secrets.SALESFORCE_USERNAME }} --password=${{ secrets.SALESFORCE_PASSWORD }} --licenseKey=${{ secrets.ORGFLOW_LICENSEKEY }} --acceptEula
echo "::set-output name=stack-name::$STACKNAME"
orgflow stack:create --name=$STACKNAME --gitRepoUrl=/tmp/$STACKNAME --username='${{ secrets.SALESFORCE_USERNAME }}' --password='${{ secrets.SALESFORCE_PASSWORD }}' --licenseKey=${{ secrets.ORGFLOW_LICENSEKEY }} --acceptEula
echo "stack-name=$STACKNAME" >> $GITHUB_OUTPUT
env:
STACKNAME: TestStack_${{ github.run_id }}_${{ github.run_number }}

Expand All @@ -34,15 +34,16 @@ jobs:
strategy:
matrix:
image: [ubuntu-latest, macos-latest, windows-latest]
version: [1, 2]
fail-fast: false
steps:
- name: Checkout source
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set up OrgFlow
uses: ./
id: setup
with:
version: "1.4"
version: ${{ matrix.version }}
license-key: ${{ secrets.ORGFLOW_LICENSEKEY }}
salesforce-username: ${{ secrets.SALESFORCE_USERNAME }}
salesforce-password: ${{ secrets.SALESFORCE_PASSWORD }}
Expand All @@ -62,7 +63,7 @@ jobs:
teardown_job:
runs-on: ubuntu-latest
container: orgflow/cli:1.4.x
container: orgflow/cli:2.x
name: Teardown
needs: [setup_job, test_job]
if: ${{ always() }}
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,17 @@ jobs:
- run: orgflow stack:list
```
Install latest 1.3.x version, save Salesforce credentials and flow metadata changes from one sandbox environment to another:
Install latest 2.0.x version, save Salesforce credentials and flow metadata changes from one sandbox environment to another:
```yaml
jobs:
orgflow_job:
runs-on: ubuntu-latest
steps:
# Download and install latest 1.3.x version
# Download and install latest 2.0.x version
- uses: orgflow-actions/setup@v1
with:
version: "1.3"
version: "2.0"
license-key: ${{ secrets.ORGFLOW_LICENSEKEY }}
salesforce-username: ${{ secrets.SALESFORCE_USERNAME }}
salesforce-password: ${{ secrets.SALESFORCE_PASSWORD }}
Expand Down Expand Up @@ -216,7 +216,7 @@ For most public Git services such as GitHub, Azure Repos, BitBucket etc., you wo

All of our `orgflow-actions/*` actions are semantically versioned. Breaking changes will cause a major version bump.

All releases are tagged with a full version number, e.g. `v1.0.0`. You can use these tags to pin your workflow to a specific release, e.g. `@v1.0.0`.
All releases are tagged with a full version number, e.g. `v1.1.0`. You can use these tags to pin your workflow to a specific release, e.g. `@v1.1.0`.

We also maintain branches for each major version of our actions, and you can reference branch names to ensure that you are using the most up to date version of this action for a specific major version. For example `@v1` would cause your workflow to automatically use the most up to date `v1.x.x` version of this action.

Expand Down
7 changes: 6 additions & 1 deletion dist/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -15666,7 +15666,12 @@ exports.setLicenseKey = setLicenseKey;
function createEncryptionKey() {
return __awaiter(this, void 0, void 0, function* () {
core.debug("Creating new encryption key...");
const encryptionKey = yield execOrgFlow("auth:key:create", "--output=flat");
const version = yield getInstalledVersion();
const useFlatOutput = version.startsWith("1.");
core.debug(`Version: ${version}, use flat output: ${useFlatOutput}.`);
const encryptionKey = useFlatOutput
? yield execOrgFlow("auth:key:create", "--output=flat")
: yield execOrgFlow("auth:key:create");
core.debug("New encryption key was successfully created.");
return encryptionKey;
});
Expand Down
10 changes: 9 additions & 1 deletion lib/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,15 @@ export async function createEncryptionKey()
{
core.debug("Creating new encryption key...");

const encryptionKey = await execOrgFlow("auth:key:create", "--output=flat");
const version = await getInstalledVersion();
const useFlatOutput = version.startsWith("1.");

core.debug(`Version: ${version}, use flat output: ${useFlatOutput}.`);

const encryptionKey =
useFlatOutput
? await execOrgFlow("auth:key:create", "--output=flat")
: await execOrgFlow("auth:key:create");

core.debug("New encryption key was successfully created.");

Expand Down

0 comments on commit 48a3f5b

Please sign in to comment.