0.4.6-2 #27
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Workflow | |
on: | |
release: | |
types: [published] | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: π₯ Checkout the repository | |
uses: actions/checkout@v2 | |
- name: π’ Get release version | |
id: version | |
run: | | |
VERSION=$(jq -r '.version' "${{ github.workspace }}/custom_components/pluggit/manifest.json") | |
echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
- name: ποΈ Set version number | |
run: | | |
jq --arg version "${{ steps.version.outputs.version }}" '.version = $version' \ | |
"${{ github.workspace }}/custom_components/pluggit/manifest.json" > tmp \ | |
&& mv -f tmp "${{ github.workspace }}/custom_components/pluggit/manifest.json" | |
- name: π Validate data | |
run: | | |
manifestversion=$(jq -r '.version' ${{ github.workspace }}/custom_components/pluggit/manifest.json) | |
if [ "$manifestversion" != "${{ steps.version.outputs.version }}" ]; then | |
echo "The version in custom_components/pluggit/manifest.json was not correct" | |
echo "$manifestversion" | |
exit 1 | |
fi | |
- name: Set the Dantherm branch | |
id: set-dantherm-branch | |
run: | | |
if [ "${{ github.event.release.prerelease }}" = "true" ]; then | |
echo "Using dev branch for pre-release" | |
echo "dantherm_branch=dev" >> $GITHUB_ENV | |
else | |
echo "Using main branch" | |
echo "dantherm_branch=main" >> $GITHUB_ENV | |
fi | |
- name: Checkout Dantherm repository | |
run: | | |
git clone --branch ${{ env.dantherm_branch }} https://github.com/Tvalley71/dantherm.git dantherm | |
- name: Copy shared code files from the Dantherm integration | |
run: | | |
cp dantherm/custom_components/dantherm/__init__.py \ | |
dantherm/custom_components/dantherm/button.py \ | |
dantherm/custom_components/dantherm/config_flow.py \ | |
dantherm/custom_components/dantherm/cover.py \ | |
dantherm/custom_components/dantherm/device.py \ | |
dantherm/custom_components/dantherm/device_map.py \ | |
dantherm/custom_components/dantherm/number.py \ | |
dantherm/custom_components/dantherm/select.py \ | |
dantherm/custom_components/dantherm/sensor.py \ | |
dantherm/custom_components/dantherm/services.py \ | |
dantherm/custom_components/dantherm/services.yaml \ | |
dantherm/custom_components/dantherm/switch.py "${{ github.workspace }}/custom_components/pluggit/" | |
cp -r dantherm/custom_components/dantherm/translations "${{ github.workspace }}/custom_components/pluggit/translations/" | |
- name: π Replace integration name in services.yaml | |
run: | | |
sed -i 's/integration: dantherm/integration: pluggit/g' custom_components/pluggit/services.yaml | |
- name: π¦ Create zip file for the integration | |
run: | | |
cd "${{ github.workspace }}/custom_components/pluggit" | |
zip pluggit.zip -r ./ | |
- name: π€ Upload the zip file as a release asset | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: "${{ github.workspace }}/custom_components/pluggit/pluggit.zip" | |
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} |