Skip to content

Commit

Permalink
Automatically release on GitHub Release creation + bump lerna to 5.1.4 (
Browse files Browse the repository at this point in the history
  • Loading branch information
tovbinm authored Jun 17, 2022
1 parent 87fc6fd commit 61e7c3b
Show file tree
Hide file tree
Showing 56 changed files with 1,508 additions and 1,831 deletions.
53 changes: 19 additions & 34 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
name: Release

on:
push:
branches:
- main
paths-ignore:
- '**.md'
release:
types: [created]

jobs:
publish-packages:
Expand All @@ -20,61 +17,42 @@ jobs:
steps:
- name: Check out
uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch tags for check below.

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 14
registry-url: https://registry.npmjs.org

- name: Extract version
id: extract-version
- name: Extract tag version
id: extract-tag-version
run: |
CDK_VERSION="$(jq -r '.version' < lerna.json)"
echo "CDK_VERSION=$CDK_VERSION" >> $GITHUB_ENV
- name: Check tag exists
uses: mukunku/[email protected]
id: check-tag
with:
tag: v${{ env.CDK_VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG="${GITHUB_REF:10}"
TAG_VERSION="${TAG//v/}"
echo "TAG_VERSION=$TAG_VERSION" >> $GITHUB_ENV
- name: Install dependencies
if: steps.check-tag.outputs.exists == 'false'
run: npm install -g npm@7 lerna && lerna bootstrap --hoist

- name: Publish CDK package
if: steps.check-tag.outputs.exists == 'false'
- name: Publish Airbyte CDK package
run: |
cd faros-airbyte-cdk && \
npm i && \
npm version ${{ env.TAG_VERSION }} && \
npm publish --access public --tag latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish Faros Destination package
if: steps.check-tag.outputs.exists == 'false'
run: |
cd destinations/airbyte-faros-destination && \
cat package.json | jq --arg V "${{ env.TAG_VERSION }}" '.dependencies."faros-airbyte-cdk" = $V' > package.json && \
npm i && \
npm version ${{ env.TAG_VERSION }} && \
npm publish --access public --tag latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Create tag
if: steps.check-tag.outputs.exists == 'false'
uses: pkgdeps/[email protected]
with:
git_commit_sha: ${{ github.sha }}
git_tag_prefix: v
github_repo: ${{ github.repository }}
github_token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ env.CDK_VERSION }}

publish-connectors:
name: Publish connectors
runs-on: ubuntu-latest
Expand All @@ -83,6 +61,13 @@ jobs:
- name: Check out
uses: actions/checkout@v3

- name: Extract tag version
id: extract-tag-version
run: |
TAG="${GITHUB_REF:10}"
TAG_VERSION="${TAG//v/}"
echo "TAG_VERSION=$TAG_VERSION" >> $GITHUB_ENV
- name: Docker login
uses: docker/[email protected]
with:
Expand All @@ -95,5 +80,5 @@ jobs:
run: |
for connector_path in $(ls -d sources/*/ destinations/*/)
do
./scripts/publish-connector.sh $connector_path
./scripts/publish-connector.sh $connector_path ${{ env.TAG_VERSION }}
done
72 changes: 34 additions & 38 deletions README.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions destinations/airbyte-faros-destination/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "airbyte-faros-destination",
"version": "0.1.99",
"version": "0.0.1",
"description": "Faros Destination for Airbyte",
"keywords": [
"airbyte",
Expand Down Expand Up @@ -36,7 +36,7 @@
"analytics-node": "^6.0.0",
"axios": "^0.26.0",
"date-format": "^4.0.6",
"faros-airbyte-cdk": "^0.1.99",
"faros-airbyte-cdk": "0.0.1",
"faros-feeds-sdk": "^0.10.0",
"fs-extra": "^10.0.0",
"git-url-parse": "^11.6.0",
Expand Down
2 changes: 1 addition & 1 deletion faros-airbyte-cdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "faros-airbyte-cdk",
"version": "0.1.99",
"version": "0.0.1",
"description": "Airbyte Connector Development Kit (CDK) for JavaScript/TypeScript",
"keywords": [
"airbyte",
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.1.99",
"version": "0.0.1",
"packages": [
"faros-airbyte-cdk",
"destinations/**",
Expand Down
Loading

0 comments on commit 61e7c3b

Please sign in to comment.