-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #650: Fix Drainpipe Dev release workflow
- Loading branch information
Showing
1 changed file
with
26 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | | ||
|
@@ -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}' |