-
-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (41 loc) · 1.89 KB
/
Copy pathrelease-drafter.yml
File metadata and controls
48 lines (41 loc) · 1.89 KB
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
name: Release Drafter
on:
push:
branches:
- main
# Release automation routes every repo operation (release-drafter, checkout, and the version-bump
# push) through the GitHub App token generated below, so the default GITHUB_TOKEN is unused here.
# Grant it no permissions at all. GitHub always mints the token; the empty set just strips its powers.
permissions: {}
jobs:
release-drafter:
name: Release Drafter
environment: release-drafter
runs-on: ubuntu-latest
steps:
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ secrets.ESPHOME_GITHUB_APP_ID }}
private-key: ${{ secrets.ESPHOME_GITHUB_APP_PRIVATE_KEY }}
- uses: release-drafter/release-drafter@4d75298e00d9e34c483e5ff8c68d0ea1c1940c1e # v7.5.1
id: drafter
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
token: ${{ steps.generate-token.outputs.token }}
- name: Update version files
run: |
sed -i "s/\"version\": .*/\"version\": \"${{ steps.drafter.outputs.resolved_version }}\",/g" library.json
sed -i "s/version: .*/version: \"${{ steps.drafter.outputs.resolved_version }}\"/g" idf_component.yml
sed -i "s/project(micro_flac VERSION .* LANGUAGES/project(micro_flac VERSION ${{ steps.drafter.outputs.resolved_version }} LANGUAGES/g" CMakeLists.txt
- name: Commit changes
run: |
if ! git diff --quiet; then
git config --global user.name "esphomebot"
git config --global user.email "68923041+esphomebot@users.noreply.github.com"
git commit -am "Bump version to ${{ steps.drafter.outputs.resolved_version }}"
git push
fi