Skip to content

Commit 750cbb9

Browse files
Merge branch 'main' into only-send-final-state-if-needed
2 parents ef3f09d + a9d6c29 commit 750cbb9

58 files changed

Lines changed: 2199 additions & 3655 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/dockerize.yaml

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,52 @@ name: Build and push Docker images
33
on:
44
push:
55
tags: '@openfn/ws-worker@**'
6+
workflow_call:
67

78
jobs:
8-
build-and-push-worker-image:
9-
name: Push Docker image to Docker Hub
9+
check-tag:
10+
name: Check if Docker tag exists
1011
runs-on: ubuntu-latest
12+
outputs:
13+
should_build: ${{ steps.check.outputs.should_build }}
14+
docker_tag: ${{ steps.extract.outputs.docker_tag }}
1115
steps:
12-
- name: Checkout
13-
uses: actions/checkout@v4
14-
- name: Manipulate tag for docker
15-
id: branch_name
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
- name: Extract Docker tag
20+
id: extract
1621
run: |
17-
SOURCE_TAG=${GITHUB_REF#refs/tags/}
22+
SOURCE_TAG=$(git tag --sort=-creatordate --list "@openfn/ws-worker@*" | head -n 1)
1823
echo Source Tag: $SOURCE_TAG
1924
2025
VERSION_TAG=${SOURCE_TAG#@openfn/ws-worker}
2126
echo Version Tag: $VERSION_TAG
22-
27+
2328
DOCKER_TAG=${VERSION_TAG#@}
2429
echo Docker Tag: $DOCKER_TAG
25-
26-
echo "DOCKER_TAG=$DOCKER_TAG" >> $GITHUB_ENV
30+
31+
echo "docker_tag=$DOCKER_TAG" >> $GITHUB_OUTPUT
32+
- name: Check if Docker tag exists
33+
id: check
34+
run: |
35+
STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
36+
https://hub.docker.com/v2/repositories/openfn/ws-worker/tags/v${{ steps.extract.outputs.docker_tag }}/)
37+
if [ "$STATUS" = "200" ]; then
38+
echo "Tag v${{ steps.extract.outputs.docker_tag }} already exists on Docker Hub, skipping build"
39+
echo "should_build=false" >> $GITHUB_OUTPUT
40+
else
41+
echo "should_build=true" >> $GITHUB_OUTPUT
42+
fi
43+
44+
build-and-push-worker-image:
45+
needs: check-tag
46+
if: needs.check-tag.outputs.should_build == 'true'
47+
name: Push Docker image to Docker Hub
48+
runs-on: ubuntu-latest
49+
steps:
50+
- name: Checkout
51+
uses: actions/checkout@v4
2752
- name: Set up QEMU
2853
uses: docker/setup-qemu-action@v3
2954
- name: Set up Docker Buildx
@@ -41,4 +66,4 @@ jobs:
4166
target: ws-worker
4267
tags: |
4368
openfn/ws-worker:latest
44-
openfn/ws-worker:v${{ env.DOCKER_TAG }}
69+
openfn/ws-worker:v${{ needs.check-tag.outputs.docker_tag }}

.github/workflows/publish.yaml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ on:
77
jobs:
88
publish:
99
runs-on: ubuntu-latest
10+
outputs:
11+
ws_worker_tagged: ${{ steps.tags.outputs.ws_worker_tagged }}
1012
steps:
11-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v6
1214
with:
1315
fetch-depth: 1
14-
- uses: actions/setup-node@v3
16+
- uses: actions/setup-node@v6
1517
with:
1618
node-version: '22.12'
1719
- uses: pnpm/action-setup@v4
@@ -22,6 +24,24 @@ jobs:
2224
env:
2325
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2426
- run: pnpm publish -r --report-summary --publish-branch main --access=public
27+
28+
- run: git config user.name ${{ secrets.GH_USER }}
29+
- run: git config user.email ${{ secrets.GH_EMAIL }}
30+
31+
- name: Push tags
32+
id: tags
33+
run: |
34+
pnpm changeset tag
35+
if git tag -l '@openfn/ws-worker@*' | grep -q .; then
36+
echo "ws_worker_tagged=true" >> $GITHUB_OUTPUT
37+
fi
38+
git push --tags
39+
2540
- run: pnpm run generate-slack-report
2641
env:
2742
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
43+
44+
dockerize:
45+
needs: publish
46+
uses: ./.github/workflows/dockerize.yaml
47+
secrets: inherit

examples/README.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

examples/dts-inspector/.postcssrc

Lines changed: 0 additions & 5 deletions
This file was deleted.

examples/dts-inspector/CHANGELOG.md

Lines changed: 0 additions & 173 deletions
This file was deleted.

examples/dts-inspector/README.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

examples/dts-inspector/esbuild.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

examples/dts-inspector/index.html

Lines changed: 0 additions & 12 deletions
This file was deleted.

examples/dts-inspector/package.json

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)