Skip to content

Commit 3e86d8c

Browse files
authored
New unlocked package (#15)
* Created new unlocked package * Updated folder structure * Setup pipeline config
1 parent d164bf2 commit 3e86d8c

File tree

39 files changed

+121
-11
lines changed

39 files changed

+121
-11
lines changed

.github/workflows/deploy.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Unique name for this workflow
2+
name: Deployment
3+
4+
on:
5+
push:
6+
paths-ignore:
7+
- 'content/**'
8+
- 'docs/**'
9+
- 'examples/**'
10+
- 'packages/**'
11+
- '.forceignore'
12+
- '.gitignore'
13+
- '.prettierignore'
14+
- '.prettierrc'
15+
- 'Contributing.md'
16+
- 'LICENSE'
17+
- 'package.json'
18+
- 'README.md'
19+
- './**/README.md'
20+
- 'sfdx-project.json'
21+
22+
jobs:
23+
scratch-org-tests:
24+
name: 'Scratch Org Tests'
25+
runs-on: ubuntu-latest
26+
environment: Test
27+
steps:
28+
# Checkout the code
29+
- name: 'Checkout source code'
30+
uses: actions/checkout@v2
31+
32+
- name: 'Setup node'
33+
uses: actions/setup-node@v2
34+
with:
35+
node-version: '14'
36+
37+
- name: 'Install npm'
38+
run: npm install
39+
40+
# Install Salesforce CLI
41+
- name: Install Salesforce CLI
42+
run: |
43+
wget https://developer.salesforce.com/media/salesforce-cli/sfdx-linux-amd64.tar.xz
44+
mkdir sfdx-cli
45+
tar xJf sfdx-linux-amd64.tar.xz -C sfdx-cli --strip-components 1
46+
./sfdx-cli/install
47+
48+
# Start remote testing
49+
50+
# Store secrets for dev hubs
51+
- name: 'Populate DevHub Auth Files'
52+
shell: bash
53+
run: |
54+
echo ${{ env.JONGPIE_DEVHUB_SFDX_URL }} > ./JONGPIE_DEVHUB_SFDX_URL.txt
55+
env:
56+
JONGPIE_DEVHUB_SFDX_URL: ${{ secrets.JONGPIE_DEVHUB_SFDX_URL }}
57+
58+
- name: 'Authorize Dev Hubs'
59+
run: |
60+
sfdx auth:sfdxurl:store --sfdxurlfile ./JONGPIE_DEVHUB_SFDX_URL.txt --setalias jongpie-devhub
61+
62+
- name: 'Create Scratch Org'
63+
run: sfdx force:org:create --targetdevhubusername jongpie-devhub --definitionfile ./config/enterprise-scratch-def.json --setalias CustomMetadataSaver --setdefaultusername
64+
65+
- name: 'Deploy Metadata'
66+
run: sfdx force:source:push
67+
68+
- name: Enable improved SFDX code coverage
69+
run: export SFDX_IMPROVED_CODE_COVERAGE=true
70+
71+
- name: 'Run Apex Tests'
72+
run: npm run test:apex
73+
74+
# Upload code coverage data for Apex
75+
# codecov integration is currently disabled due to
76+
# issues with parsing sfdx codecoverage files
77+
# - name: 'Upload code coverage for Apex to Codecov.io'
78+
# uses: codecov/[email protected]
79+
# with:
80+
# token: ${{ secrets.CODECOV_TOKEN }}
81+
# flags: Apex
82+
83+
- name: 'Delete Scratch Org'
84+
run: sfdx force:org:delete --json --noprompt
85+
if: ${{ always() }}

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# Custom Metadata Saver for Salesforce
22

3-
<a href="https://githubsfdeploy.herokuapp.com?owner=jongpie&repo=CustomMetadataSaver&ref=main">
4-
<img alt="Deploy to Salesforce"
5-
src="https://raw.githubusercontent.com/afawcett/githubsfdeploy/master/deploy.png">
6-
</a>
3+
[![Install Unlocked Package](./content/btn-install-unlocked-package.png)](https://login.salesforce.com/packaging/installPackage.apexp?p0=04t4x000000FDcnAAG)
74

85
This is a small library that can be used in Salesforce to update & deploy changes to custom metadata types (CMDT) from Apex and Flow.
96

codecov.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
coverage:
2+
status:
3+
project:
4+
default:
5+
range: 75...100
6+
round: down
7+
precision: 2
8+
threshold: 1%
9+
if_ci_failed: success
10+
patch: off
25.6 KB
Loading

force-app/main/custom-metadata-saver/classes/CustomMetadataSaver.cls renamed to custom-metadata-saver/main/classes/CustomMetadataSaver.cls

File renamed without changes.

force-app/main/custom-metadata-saver/classes/CustomMetadataTableController.cls-meta.xml renamed to custom-metadata-saver/main/classes/CustomMetadataSaver.cls-meta.xml

File renamed without changes.

force-app/main/custom-metadata-saver/classes/CustomMetadataTableController.cls renamed to custom-metadata-saver/main/classes/CustomMetadataTableController.cls

File renamed without changes.

force-app/tests/custom-metadata-saver/classes/CustomMetadataTableController_Tests.cls-meta.xml renamed to custom-metadata-saver/main/classes/CustomMetadataTableController.cls-meta.xml

File renamed without changes.

force-app/main/custom-metadata-saver/classes/FlowCustomMetadataCreator.cls renamed to custom-metadata-saver/main/classes/FlowCustomMetadataCreator.cls

File renamed without changes.

force-app/main/custom-metadata-saver/classes/FlowCustomMetadataCreator.cls-meta.xml renamed to custom-metadata-saver/main/classes/FlowCustomMetadataCreator.cls-meta.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
3-
<apiVersion>51.0</apiVersion>
3+
<apiVersion>52.0</apiVersion>
44
<status>Active</status>
55
</ApexClass>

0 commit comments

Comments
 (0)