Skip to content

Commit e302d87

Browse files
authored
Publish workflows (#27)
1 parent f77d750 commit e302d87

File tree

3 files changed

+107
-0
lines changed

3 files changed

+107
-0
lines changed

.github/release-drafter.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name-template: "v$RESOLVED_VERSION"
2+
tag-template: "v$RESOLVED_VERSION"
3+
categories:
4+
- title: "Breaking Changes"
5+
label: "breaking-change"
6+
- title: "Dependencies"
7+
collapse-after: 1
8+
labels:
9+
- "dependencies"
10+
11+
version-resolver:
12+
major:
13+
labels:
14+
- "major"
15+
- "breaking-change"
16+
minor:
17+
labels:
18+
- "minor"
19+
- "new-feature"
20+
patch:
21+
labels:
22+
- "bugfix"
23+
- "dependencies"
24+
- "documentation"
25+
- "enhancement"
26+
default: patch
27+
28+
template: |
29+
## What's Changed
30+
31+
$CHANGES
32+
33+
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION

.github/workflows/publish.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish-platformio:
9+
name: Publish to PlatformIO
10+
runs-on: ubuntu-latest
11+
environment: platformio
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Set up Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: '3.x'
18+
- name: Install platformio
19+
run: pip install --upgrade platformio
20+
- name: Publish package
21+
env:
22+
PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_AUTH_TOKEN }}
23+
run: pio package publish --owner improv --non-interactive
24+
25+
publish-espressif:
26+
name: Publish to Espressif
27+
runs-on: ubuntu-latest
28+
environment: espressif
29+
steps:
30+
- uses: actions/checkout@v4
31+
- name: Publish package
32+
uses: espressif/upload-components-ci-action@v2
33+
with:
34+
version: ${{ github.event.release.tag_name }}
35+
components: |
36+
improv: .
37+
namespace: improv
38+
api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}

.github/workflows/release-drafter.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
pull-requests: read
11+
12+
jobs:
13+
release-drafter:
14+
name: Release Drafter
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: release-drafter/release-drafter@v6
18+
id: drafter
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
22+
- uses: actions/checkout@v4
23+
24+
- name: Update version files
25+
run: |
26+
sed -i "s/\"version\": .*/\"version\": \"${{ steps.drafter.outputs.resolved_version }}\",/g" library.json
27+
sed -i "s/improv VERSION .*)/improv VERSION ${{ steps.drafter.outputs.resolved_version }})/g" CMakeLists.txt
28+
29+
- name: Commit changes
30+
run: |
31+
if ! git diff --quiet; then
32+
git config --global user.name "esphomebot"
33+
git config --global user.email "[email protected]"
34+
git commit -am "Bump version to ${{ steps.drafter.outputs.resolved_version }}"
35+
git push
36+
fi

0 commit comments

Comments
 (0)