-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ea01b2a
commit 4c8be33
Showing
4 changed files
with
917 additions
and
861 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
pull_request: | ||
branches: | ||
- "**" | ||
|
||
jobs: | ||
build-processor: | ||
runs-on: ubuntu-latest | ||
|
||
defaults: | ||
run: | ||
working-directory: processor | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js 18.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "18.x" | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: ESLint check | ||
run: npm run lint | ||
|
||
- name: Prettier check | ||
run: npm run prettier:check | ||
|
||
- name: Build project | ||
run: npm run build | ||
|
||
- name: Run tests | ||
run: npm run test | ||
|
||
- name: Run audit | ||
run: npm audit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Publish | ||
|
||
on: | ||
push: | ||
tags: | ||
# Release tags v1.0.0, v1.0.1, v1.0.2, etc. | ||
- 'v[0-9]+.[0-9]+.[0-9]+' | ||
# Pre-release tags v1.0.0-alpha.0, v1.0.0-beta.0, etc. | ||
- 'v[0-9]+.[0-9]+.[0-9]+-[a-z]+.[0-9]+' | ||
- latest | ||
workflow_dispatch: | ||
|
||
jobs: | ||
publish: | ||
name: Publish for commercetools Checkout | ||
runs-on: ubuntu-latest | ||
if: github.ref_type == 'tag' | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js 20 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Install | ||
env: | ||
CTP_CLIENT_ID: ${{ secrets.CTP_CLIENT_ID }} | ||
CTP_CLIENT_SECRET: ${{ secrets.CTP_CLIENT_SECRET }} | ||
CTP_CONNECTOR_KEY: ${{ secrets.CTP_CONNECTOR_KEY }} | ||
CTP_REGION: ${{ secrets.CTP_REGION }} | ||
run: | | ||
echo Updating connector to tag $GITHUB_REF_NAME | ||
echo Authenticating with commercetools | ||
OAUTH_RESPONSE=$(curl --silent --show-error --location --request POST "https://auth.$CTP_REGION.commercetools.com/oauth/token?grant_type=client_credentials" -u $CTP_CLIENT_ID:$CTP_CLIENT_SECRET) | ||
ACCESS_TOKEN=$(echo $OAUTH_RESPONSE | jq -r '.access_token') | ||
echo Access token retrieved | ||
CONNECTOR_DETAILS=$(curl --silent --show-error --location "https://connect.$CTP_REGION.commercetools.com/connectors/drafts/key=$CTP_CONNECTOR_KEY" \ | ||
--header 'Content-Type: application/json' \ | ||
--header "Authorization: Bearer $ACCESS_TOKEN") | ||
VERSION=$(echo $CONNECTOR_DETAILS | jq -r '.version') | ||
echo Updating version $VERSION | ||
curl --fail-with-body --silent --location POST "https://connect.$CTP_REGION.commercetools.com/connectors/drafts/key=$CTP_CONNECTOR_KEY" \ | ||
--header 'Content-Type: application/json' \ | ||
--header "Authorization: Bearer $ACCESS_TOKEN" \ | ||
--data-raw "{\"version\": $VERSION, \"actions\": [{\"action\": \"setRepository\",\"url\": \"[email protected]:mollie/commercetools-connector.git\",\"tag\": \"$GITHUB_REF_NAME\"},{\"action\": \"updatePreviewable\"}]}" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.