mirror of
https://github.com/lildude/ha-addon-teslamate.git
synced 2026-10-13 21:19:16 -04:00
Matt ffffff/releaseautomation (#6)
* Add release automation * Update to build release versions * use github_ref
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
semverIncrement:
|
||||
description: Increment major/minor/patch using values of m/i/p
|
||||
required: true
|
||||
default: i
|
||||
|
||||
name: Create Release
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Create Release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Teslamate
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: teslamate
|
||||
- name: Get latest release
|
||||
run: |
|
||||
echo "latest_release=$(curl --silent https://api.github.com/repos/$GITHUB_REPOSITORY/releases/latest | jq -r .tag_name | sed s/v// )" >> $GITHUB_ENV
|
||||
- name: Increment semver
|
||||
id: semver
|
||||
uses: matt-FFFFFF/simple-semver@v0.1.0
|
||||
with:
|
||||
semver-input: ${{ env.latest_release }}
|
||||
increment: i
|
||||
- name: Create tag
|
||||
run: |
|
||||
git config --global user.email "actions.no-reply@github.com"
|
||||
git config --global user.name "GitHub Actions"
|
||||
git tag -a v${{ steps.semver.outputs.semver }} -m 'Release automation'
|
||||
git push --tags
|
||||
working-directory: ${{ github.workspace }}/teslamate
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: v${{ steps.semver.outputs.semver }}
|
||||
release_name: Release v${{ steps.semver.outputs.semver }}
|
||||
body_path: CHANGELOG.md
|
||||
draft: false
|
||||
prerelease: false
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
path: repo
|
||||
repository: matt-FFFFFF/hassio-addon-repository
|
||||
token: ${{ secrets.REPO_PAT }}
|
||||
- name: Update addon repo
|
||||
run: |
|
||||
cp -vf ${{ github.workspace }}/teslamate/*.png ${{ github.workspace }}/repo/teslamate
|
||||
cp -vf ${{ github.workspace }}/teslamate/*.md ${{ github.workspace }}/repo/teslamate
|
||||
jq '.version="${{ steps.semver.outputs.semver }}"' < ${{ github.workspace }}/teslamate/config.json > ${{ github.workspace }}/repo/teslamate/config.json
|
||||
- name: Add changes to addon repo
|
||||
run: |
|
||||
git add .
|
||||
git commit -m 'Update from hassio-addon-teslamate'
|
||||
git push
|
||||
working-directory: ${{ github.workspace }}/repo/teslamate
|
||||
|
||||
Reference in New Issue
Block a user