Skip to content

Merge pull request #7 from coldbox-modules/ci/addBoxlangToMatrix #14

Merge pull request #7 from coldbox-modules/ci/addBoxlangToMatrix

Merge pull request #7 from coldbox-modules/ci/addBoxlangToMatrix #14

Workflow file for this run

name: twilio-sdk CI
# Only on Development we build snapshots
on:
push:
branches:
- development
- main
env:
MODULE_ID: twilio-sdk
jobs:
#############################################
# Tests First baby! We fail, no build :(
#############################################
tests:
uses: ./.github/workflows/tests.yml
secrets:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
TWILIO_ACCOUNT_SID: ${{ secrets.TWILIO_ACCOUNT_SID }}
TWILIO_AUTHTOKEN: ${{ secrets.TWILIO_AUTHTOKEN }}
TWILIO_TEST_ACCOUNT_SID: ${{ secrets.TWILIO_TEST_ACCOUNT_SID }}
TWILIO_TEST_AUTHTOKEN: ${{ secrets.TWILIO_TEST_AUTHTOKEN }}
#############################################
# Build ContentBox
#############################################
build:
name: Build & Publish
needs: tests
runs-on: ubuntu-20.04
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: "adopt"
java-version: "11"
- name: Cache CommandBox Dependencies
uses: actions/cache@v1
if: ${{ true }}
with:
path: ~/.CommandBox/artifacts
key: ${{ runner.OS }}-commandbox-cache-${{ hashFiles( 'box.json' ) }}-${{ hashFiles( 'test-harness/box.json' ) }}
restore-keys: |
${{ runner.OS }}-commandbox-cache-${{ hashFiles( 'box.json' ) }}-${{ hashFiles( 'test-harness/box.json' ) }}
- name: Setup CommandBox
uses: Ortus-Solutions/setup-commandbox@main
with:
forgeboxAPIKey: ${{ secrets.FORGEBOX_TOKEN }}
- name: Setup Environment Variables For Build Process
id: current_version
run: |
echo "VERSION=`cat box.json | jq '.version' -r`" >> $GITHUB_ENV
box package set [email protected]@[email protected]@
# main or snapshot
echo "Github Ref is $GITHUB_REF"
echo "BRANCH=main" >> $GITHUB_ENV
if [ $GITHUB_REF == 'refs/heads/development' ]
then
echo "BRANCH=development" >> $GITHUB_ENV
fi
- name: Install and Configure Semantic Release
run: |
box install commandbox-semantic-release
box config set endpoints.forgebox.APIToken=${{ secrets.FORGEBOX_TOKEN }}
box config set modules.commandbox-semantic-release.targetBranch=main
box config set modules.commandbox-semantic-release.plugins='{ "VerifyConditions": "GitHubActionsConditionsVerifier@commandbox-semantic-release", "FetchLastRelease": "ForgeBoxReleaseFetcher@commandbox-semantic-release", "RetrieveCommits": "JGitCommitsRetriever@commandbox-semantic-release", "ParseCommit": "ConventionalChangelogParser@commandbox-semantic-release", "FilterCommits": "DefaultCommitFilterer@commandbox-semantic-release", "AnalyzeCommits": "DefaultCommitAnalyzer@commandbox-semantic-release", "VerifyRelease": "NullReleaseVerifier@commandbox-semantic-release", "GenerateNotes": "GitHubMarkdownNotesGenerator@commandbox-semantic-release", "UpdateChangelog": "FileAppendChangelogUpdater@commandbox-semantic-release", "CommitArtifacts": "NullArtifactsCommitter@commandbox-semantic-release", "PublishRelease": "ForgeBoxReleasePublisher@commandbox-semantic-release", "PublicizeRelease": "GitHubReleasePublicizer@commandbox-semantic-release" }'
- name: Run Semantic Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: box semantic-release
# - name: Upload Build Artifacts
# if: success()
# uses: actions/upload-artifact@v2
# with:
# name: twilio-sdk
# path: |
# .artifacts/**/*
# - name: Upload Binaries to S3
# uses: jakejarvis/s3-sync-action@master
# with:
# args: --acl public-read
# env:
# AWS_S3_BUCKET: "downloads.ortussolutions.com"
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_SECRET }}
# SOURCE_DIR: ".artifacts/${{ env.MODULE_ID }}"
# DEST_DIR: "ortussolutions/coldbox-modules/${{ env.MODULE_ID }}"
- name: Inform Slack of Build
if: ${{ always() }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: coding
SLACK_COLOR: ${{ job.status }} # or a specific color like 'green' or '#ff00ff'
SLACK_ICON_EMOJI: ":bell:"
SLACK_MESSAGE: '${{ env.MODULE_ID }} Built with ${{ job.status }}!'
SLACK_TITLE: "${{ env.MODULE_ID }} Build"
SLACK_USERNAME: CI
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}