Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

fix(release): push the self-hosted tag with an App token before the image (#16964)

Othman Abu Ajamieh71536c159ced
diff --git a/.github/workflows/release-self-hosted.yml b/.github/workflows/release-self-hosted.yml
index 6b1a4f8b871..d3550a8bbbc 100644
--- a/.github/workflows/release-self-hosted.yml
+++ b/.github/workflows/release-self-hosted.yml
@@ -66,6 +66,21 @@ jobs:
- name: Fail if tag already exists
run: '! docker manifest inspect activepieces/activepieces:${{ inputs.tag }}'
+ - name: Create GitHub App token
+ id: app-token
+ uses: actions/create-github-app-token@v2
+ with:
+ app-id: ${{ secrets.RELEASE_APP_ID }}
+ private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
+
+ - name: Create git tag
+ env:
+ TAG: ${{ inputs.tag }}
+ TOKEN: ${{ steps.app-token.outputs.token }}
+ run: |
+ git tag "$TAG"
+ git -c http.https://github.com/.extraheader= push "https://x-access-token:${TOKEN}@github.com/${GITHUB_REPOSITORY}.git" "refs/tags/$TAG"
+
- name: Login to Docker Hub
uses: docker/login-action@v4
with:
@@ -97,10 +112,19 @@ jobs:
activepieces/activepieces:${{ inputs.tag }}
ghcr.io/activepieces/activepieces:${{ inputs.tag }}
- - name: Create git tag
+ - name: Check if this release is the newest
+ id: latest
+ env:
+ TAG: ${{ inputs.tag }}
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
- git tag -f ${{ inputs.tag }}
- git push origin ${{ inputs.tag }} --force
+ if ! CURRENT="$(gh release view --json tagName --jq .tagName)"; then
+ echo "::warning::Could not read the current Latest release, so $TAG is not marked Latest. Mark it by hand if it is the newest release."
+ echo "latest=false" >> "$GITHUB_OUTPUT"
+ exit 0
+ fi
+ HIGHEST="$(printf '%s\n%s\n' "$CURRENT" "$TAG" | sort -V | tail -1)"
+ echo "latest=$([ "$HIGHEST" = "$TAG" ] && echo true || echo false)" >> "$GITHUB_OUTPUT"
- name: Create or update changelog via release-drafter
if: ${{ !contains(inputs.tag, '-rc') || inputs.publish_rc_release }}
@@ -111,7 +135,7 @@ jobs:
tag: ${{ inputs.tag }}
name: ${{ inputs.tag }}
version: ${{ inputs.tag }}
- latest: ${{ !contains(inputs.tag, '-rc') }}
+ latest: ${{ !contains(inputs.tag, '-rc') && steps.latest.outputs.latest == 'true' }}
publish: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}