-
Notifications
You must be signed in to change notification settings - Fork 14
79 lines (67 loc) · 2.54 KB
/
DrainpipeDev.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Push Drainpipe Dev Package
on:
push:
branches:
- '**'
tags:
- 'v*'
concurrency:
group: drainpipe-dev
cancel-in-progress: false
permissions:
contents: read
jobs:
Drainpipe-Dev:
name: Push to drainpipe-dev
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: ./scaffold/github/actions/common/setup-git
with:
git-name: Drainpipe Bot
git-email: no-reply@example.com
- name: Setup SSH
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.DRAINPIPE_DEV_DEPLOY_KEY }}
log-public-key: false
- name: Create git checkout of drainpipe-dev
working-directory: drainpipe-dev
run: |
git init
git branch -m ${{ github.ref_name }}
git remote add origin git@github.com:Lullabot/drainpipe-dev.git
git fetch origin
- name: Commit changes (Tag)
if: ${{ startsWith(github.ref, 'refs/tags/') }}
working-directory: drainpipe-dev
run: |
git reset --mixed origin/main
git add -A
git commit -m "${{ github.ref_name }}" --allow-empty
- name: Commit changes (Branch)
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
working-directory: drainpipe-dev
run: |
git reset --mixed origin/${{ github.ref_name }} || git reset --mixed origin/main
git add -A
git commit -m "${{ github.event.head_commit.message }}" --allow-empty
- 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}'