From 4389b26d9b6a7df7e49f70081816fe7171bcefd6 Mon Sep 17 00:00:00 2001 From: Pavel Slama Date: Sat, 12 Dec 2020 20:56:27 +0100 Subject: [PATCH] CI release --- .github/workflows/build.yml | 2 -- .github/workflows/release.yml | 37 +++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b0a06f7..53d9c0e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,8 +7,6 @@ on: pull_request: branches: - "*" - schedule: - - cron: "0 8 1 * *" jobs: platformio-build: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..37ff23c --- /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: ${{ steps.prepare.outputs.version }} + body_path: CHANGELOG.md + draft: false + prerelease: false \ No newline at end of file