From f361be1fcda146d711e89b49a3797a1de0de9d04 Mon Sep 17 00:00:00 2001 From: koenkk Date: Sat, 2 Dec 2023 12:37:24 +0100 Subject: [PATCH] Add release pipeline --- .github/workflows/release.yml | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..8cc3917cf --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,42 @@ +on: + repository_dispatch: + types: release + workflow_dispatch: + inputs: + version: + description: '1.34.0-1' + required: true + +name: Release + +permissions: {} +jobs: + release: + permissions: + contents: write + pull-requests: write + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: master + token: ${{ secrets.GH_TOKEN }} + - name: Set variables + id: version + run: | + echo "addon=${{ github.event.client_payload.version }}" >> "$GITHUB_OUTPUT" + echo "z2m=$(echo "${{ github.event.client_payload.version }}" | cut -d - -f 1)" >> "$GITHUB_OUTPUT" + - name: Set version and update release + run: | + jq '.version = "${{ steps.version.outputs.addon }}"' zigbee2mqtt/config.json > zigbee2mqtt/config.json.tmp + mv zigbee2mqtt/config.json.tmp zigbee2mqtt/config.json + echo -e "## ${{ steps.version.outputs.addon }}\n- Updated Zigbee2MQTT to version [\`${{ steps.version.outputs.z2m }}\`](https://github.com/Koenkk/zigbee2mqtt/releases/tag/${{ steps.version.outputs.z2m }})\n" | cat - zigbee2mqtt/CHANGELOG.md > zigbee2mqtt/CHANGELOG.md.tmp + mv zigbee2mqtt/CHANGELOG.md.tmp zigbee2mqtt/CHANGELOG.md + - uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "v${{ steps.version.outputs.addon }}" + - uses: ncipollo/release-action@v1 + with: + tag: "v${{ steps.version.outputs.addon }}" + body: "- Updated Zigbee2MQTT to version [\`${{ steps.version.outputs.z2m }}\`](https://github.com/Koenkk/zigbee2mqtt/releases/tag/${{ steps.version.outputs.z2m }})"