Skip to content

Commit 2bb0206

Browse files
authored
Update e2e.yml
1 parent 59f100e commit 2bb0206

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

Diff for: .github/workflows/e2e.yml

+24-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ jobs:
2424
- uses: actions/checkout@v2
2525
- run: |
2626
PROBE_VERSION="$(python setup.py --version)"
27-
echo "PROBE_VERSION=$PROBE_VERSION" >> $GITHUB_ENV
27+
echo "SPP_PROBE_VERSION=$PROBE_VERSION" >> $GITHUB_ENV
2828
- run: python setup.py sdist
29-
- run: cp dist/sourceplusplus-${{ env.PROBE_VERSION }}.tar.gz e2e && ls && pwd
29+
- run: cp dist/sourceplusplus-${{ env.SPP_PROBE_VERSION }}.tar.gz e2e && ls && pwd
3030
- run: cd e2e && docker-compose up -d
3131
- name: Docker IPs
3232
run: docker inspect --format='{{.Name}} - {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aq)
@@ -90,3 +90,25 @@ jobs:
9090
- name: Docker logs
9191
run: cd e2e && docker-compose logs -t --tail="all"
9292
if: ${{ always() }}
93+
94+
- name: Remove Old Release Drafts
95+
if: github.ref == 'refs/heads/master'
96+
env:
97+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
98+
run: |
99+
curl -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/repos/$GITHUB_REPOSITORY/releases \
100+
| tr '\r\n' ' ' \
101+
| jq '.[] | select(.draft == true) | .id' \
102+
| xargs -I '{}' \
103+
curl -X DELETE -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/repos/$GITHUB_REPOSITORY/releases/{}
104+
105+
- name: Create Release Draft
106+
if: github.ref == 'refs/heads/master'
107+
id: createDraft
108+
uses: actions/create-release@v1
109+
env:
110+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
111+
with:
112+
tag_name: ${{ env.SPP_PROBE_VERSION }}
113+
release_name: v${{ env.SPP_PROBE_VERSION }}
114+
draft: true

0 commit comments

Comments
 (0)