Skip to content

Commit 365fe87

Browse files
authored
fix: use drone for release steps (#55)
* use drone for release steps * use github actions for github release after tag
1 parent 590b822 commit 365fe87

File tree

8 files changed

+65
-53
lines changed

8 files changed

+65
-53
lines changed

.drone.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
kind: pipeline
3+
type: docker
4+
name: versioning
5+
trigger:
6+
paths:
7+
exclude:
8+
- ".github/*"
9+
- "docs/*"
10+
- "tests/*"
11+
branch:
12+
- master
13+
event:
14+
- push
15+
steps:
16+
- name: versioning
17+
image: node:16.17-alpine
18+
environment:
19+
GH_TOKEN:
20+
from_secret: GH_READ_TOKEN
21+
commands:
22+
- |
23+
apk add git
24+
echo "Overriding default git credentials ..."
25+
## remove credentials
26+
rm /root/.netrc
27+
## reset committer and author names (populated from the commit metadata where this pipeline is defined on)
28+
export GIT_COMMITTER_NAME="deliveryhero-bot"
29+
export GIT_COMMITTER_EMAIL="[email protected]"
30+
export GIT_AUTHOR_NAME="deliveryhero-bot"
31+
export GIT_AUTHOR_EMAIL="[email protected]"
32+
## setting credential helper based on GH TOKEN
33+
git config credential.helper '!f() { echo username=deliveryhero-bot; echo "password=$GITHUB_TOKEN"; };f'
34+
cp -r .github/release/. .
35+
npm i --silent
36+
npx semantic-release

.github/release/.releaserc.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"branches": ["master"],
3+
"verifyConditions": ["@semantic-release/changelog", "@semantic-release/git"],
4+
"prepare": [
5+
"@semantic-release/changelog",
6+
{
7+
"path": "@semantic-release/exec",
8+
"cmd": "echo -n \"${nextRelease.version}\" > .release-version"
9+
},
10+
{
11+
"path": "@semantic-release/git",
12+
"assets": ["CHANGELOG.md"],
13+
"message": "release: ${nextRelease.version} [ci skip]"
14+
}
15+
]
16+
}
File renamed without changes.

.github/workflows/release.yaml

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,20 @@
1-
name: Semantic Release
2-
1+
name: Github Release
32
on:
43
push:
54
branches:
65
- master
7-
86
jobs:
9-
semantic-release:
10-
name: Semantic Release
7+
release:
118
runs-on: ubuntu-latest
129
permissions:
1310
contents: write
14-
1511
steps:
1612
- name: Checkout
1713
uses: actions/checkout@v4
14+
- name: Release
15+
uses: softprops/action-gh-release@v2
16+
if: github.ref_type == 'tag'
1817
with:
19-
fetch-depth: 0
20-
persist-credentials: false
21-
22-
- uses: actions/setup-node@v3
23-
with:
24-
node-version: "lts/*"
25-
26-
- name: Semantic Release
27-
uses: cycjimmy/semantic-release-action@v2
28-
id: semantic # Need an `id` for output variables
29-
with:
30-
semantic_version: 17
31-
extra_plugins: |
32-
@semantic-release/changelog@5
33-
@semantic-release/exec@5
34-
@semantic-release/git@9
35-
env:
36-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37-
38-
- name: Do something when a new release published
39-
if: steps.semantic.outputs.new_release_published == 'true'
40-
run: |
41-
echo ${{ steps.semantic.outputs.new_release_version }}
42-
echo ${{ steps.semantic.outputs.new_release_major_version }}
43-
echo ${{ steps.semantic.outputs.new_release_minor_version }}
44-
echo ${{ steps.semantic.outputs.new_release_patch_version }}
18+
token: ${{ secrets.GITHUB_TOKEN }}
19+
generate_release_notes: true
20+
make_latest: true

.github/workflows/tox.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Run tox
1+
name: Run tests
22

33
on: [pull_request]
44

.releaserc.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ pip install black
6363
black .
6464
```
6565

66+
## Release
67+
68+
The release process is automated using Drone CI. See [drone.yml](.drone.yml) for details. We use [semantic-release](https://github.com/semantic-release/semantic-release) for versioning and tagging.To trigger a release create a release PR following the semantic release commit message format.
69+
6670
## License, history and contributors
6771

6872
[The LICENSE](LICENSE) is Apache License 2.0. Most of the code in this repository was initially written at [opendev.org/opendev/grafyaml](https://opendev.org/opendev/grafyaml) before being forked to here.

package.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)