Skip to content

Commit

Permalink
Issue #650: Fix Drainpipe Dev release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
justafish committed Aug 16, 2024
1 parent 5562b04 commit 793a4ed
Showing 1 changed file with 26 additions and 17 deletions.
43 changes: 26 additions & 17 deletions .github/workflows/DrainpipeDev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,18 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Add drainpipe-dev deploy key in order to run git clone
uses: webfactory/[email protected]
- uses: ./drainpipe/scaffold/github/actions/common/set-env

- uses: ./drainpipe/scaffold/github/actions/common/setup-git
with:
git-name: Drainpipe Bot
git-email: [email protected]

- uses: ./drainpipe/scaffold/github/actions/common/setup-ssh
with:
ssh-private-key: ${{ secrets.DRAINPIPE_DEV_DEPLOY_KEY }}
log-public-key: false
ssh-known-hosts: ${{ variables.SSH_KNOWN_HOSTS }}

# Commits made by the https://github.com/apps/lullabot-drainpipe application.
# @see https://github.com/orgs/community/discussions/24664
- name: Create git checkout of drainpipe-dev
working-directory: drainpipe-dev
run: |
Expand All @@ -37,22 +41,27 @@ jobs:
git remote add origin [email protected]:Lullabot/drainpipe-dev.git
git fetch origin
git reset --mixed origin/${{ github.ref_name }} || git reset --mixed origin/main
git config user.name "Lullabot-Drainpipe[bot]"
git config user.email "157769597+Lullabot-Drainpipe[bot]@users.noreply.github.com"
- name: Push branch to drainpipe-dev
working-directory: drainpipe-dev
run: |
git add -A
git commit -m "$COMMIT_MESSAGE" --allow-empty
git push origin ${{ github.ref_name }}
env:
# Workaround if the commit message contains quotes.
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
git commit -m "${{ github.event.commits[0].message }}" --allow-empty
- name: Push tag to drainpipe-dev
- name: Tag release
if: ${{ startsWith(github.ref, 'refs/tags/') }}
working-directory: drainpipe-dev
run: |
git tag ${{ github.ref_name }}
- name: Push to drainpipe-dev
working-directory: drainpipe-dev
run: |
git push origin ${{ github.ref_name }}
- name: Create release
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.DRAINPIPE_DEV_RELEASE_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/lullabot/drainpipe-dev/releases \
-d '{"tag_name":"${{ github.ref_name }}","name":"${{ github.ref_name }}","body":"See <a href=\"https://github.com/Lullabot/drainpipe/releases/tag/${{ github.ref_name }}\">https://github.com/Lullabot/drainpipe/releases/tag/${{ github.ref_name }}</a>","draft":false,"prerelease":false,"generate_release_notes":false}'

0 comments on commit 793a4ed

Please sign in to comment.