From aa1dd1564486d84e4e1e482f1183ed359562882a Mon Sep 17 00:00:00 2001 From: Pavel Slama Date: Mon, 28 Dec 2020 11:03:56 +0100 Subject: [PATCH] CI update --- .github/workflows/hassfest.yaml | 16 -------- .github/workflows/release.yml | 37 +++++++++++++++++++ .../{hacs_validate.yaml => validate.yaml} | 18 ++++++--- 3 files changed, 50 insertions(+), 21 deletions(-) delete mode 100644 .github/workflows/hassfest.yaml create mode 100644 .github/workflows/release.yml rename .github/workflows/{hacs_validate.yaml => validate.yaml} (51%) diff --git a/.github/workflows/hassfest.yaml b/.github/workflows/hassfest.yaml deleted file mode 100644 index 1be0e98..0000000 --- a/.github/workflows/hassfest.yaml +++ /dev/null @@ -1,16 +0,0 @@ -name: Validate with hassfest - -on: - push: - paths-ignore: - - "README.md" - pull_request: - schedule: - - cron: "30 7 1 * *" - -jobs: - validate: - runs-on: "ubuntu-latest" - steps: - - uses: "actions/checkout@v2" - - uses: home-assistant/actions/hassfest@master diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..c516e2a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,37 @@ +name: release + +on: + push: + tags: + - "v*" + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Prepare + id: prepare + run: | + git fetch --prune --unshallow --tags -f + + VERSION=$(git tag --points-at HEAD) + VERSION=${VERSION//v} + + echo "## :bookmark_tabs: Changes" >>"CHANGELOG.md" + git log --pretty=format:"- %s %H%n" $(git describe --abbrev=0 --tags $(git describe --tags --abbrev=0)^)...$(git describe --tags --abbrev=0) >>"CHANGELOG.md" + + echo ::set-output name=version::${VERSION} + + - name: Create Release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ steps.prepare.outputs.version }} + body_path: CHANGELOG.md + draft: false + prerelease: false \ No newline at end of file diff --git a/.github/workflows/hacs_validate.yaml b/.github/workflows/validate.yaml similarity index 51% rename from .github/workflows/hacs_validate.yaml rename to .github/workflows/validate.yaml index be2c395..b4f6a0a 100644 --- a/.github/workflows/hacs_validate.yaml +++ b/.github/workflows/validate.yaml @@ -1,19 +1,27 @@ -name: Validate with HACS +name: Validate on: push: paths-ignore: - - "README.md" - schedule: - - cron: "30 7 1 * *" + - 'README.md' + branches: + - master + pull_request: + branches: + - '*' jobs: validate: runs-on: "ubuntu-latest" steps: - - uses: "actions/checkout@v2" + - name: Checkout + uses: "actions/checkout@v2" + - name: HACS validation uses: "hacs/integration/action@master" with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CATEGORY: "integration" + + - name: HASSFEST + uses: home-assistant/actions/hassfest@master