Skip to content

Commit

Permalink
Issue #650: Fix Drainpipe Dev release workflow (#657)
Browse files Browse the repository at this point in the history
  • Loading branch information
justafish authored Aug 16, 2024
1 parent 5562b04 commit 5caf41f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 20 deletions.
38 changes: 23 additions & 15 deletions .github/workflows/DrainpipeDev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,17 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Add drainpipe-dev deploy key in order to run git clone
- uses: ./scaffold/github/actions/common/setup-git
with:
git-name: Drainpipe Bot
git-email: [email protected]

- name: Setup SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.DRAINPIPE_DEV_DEPLOY_KEY }}
log-public-key: false

# 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 +40,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}'
11 changes: 6 additions & 5 deletions .github/workflows/DrainpipeDevClean.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Add drainpipe-dev deploy key in order to run git clone
- uses: ./scaffold/github/actions/common/setup-git
with:
git-name: Drainpipe Bot
git-email: [email protected]

- name: Setup SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.DRAINPIPE_DEV_DEPLOY_KEY }}
log-public-key: false

# 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 @@ -32,8 +35,6 @@ jobs:
git remote add origin [email protected]:Lullabot/drainpipe-dev.git
git fetch origin
git reset --mixed origin/${{ github.event.ref }}
git config user.name "Lullabot-Drainpipe[bot]"
git config user.email "157769597+Lullabot-Drainpipe[bot]@users.noreply.github.com"
- name: Delete ref from drainpipe-dev
working-directory: drainpipe-dev
Expand Down

0 comments on commit 5caf41f

Please sign in to comment.