From a29fbeca9072d3375d100dbf4037f524e921fce0 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..dee755acd --- /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: + update_dep: + 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 + run: | # TODO github.event.inputs.version -> github.event.client_payload.version + echo "ADDON_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV + echo "Z2M_VERSION=$(echo ${ADDON_VERSION%-*})" >> $GITHUB_ENV + - name: Set version and update release + run: | + jq '.version = "$ADDON_VERSION"' zigbee2mqtt/config.json > zigbee2mqtt/config.json.tmp + mv zigbee2mqtt/config.json.tmp zigbee2mqtt/config.json + echo -e "## $ADDON_VERSION\n- Updated Zigbee2MQTT to version [\`$Z2M_VERSION\`](https://github.com/Koenkk/zigbee2mqtt/releases/tag/$Z2M_VERSION)\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$ADDON_VERSION" + # TODO + # - uses: ncipollo/release-action@v1 + # with: + # tag: "v$ADDON_VERSION" + # body: "- Updated Zigbee2MQTT to version [\`$Z2M_VERSION\`](https://github.com/Koenkk/zigbee2mqtt/releases/tag/$Z2M_VERSION)"