Skip to content

Commit

Permalink
Create o365release.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerSelwyn committed Sep 6, 2021
1 parent 619c733 commit b1182ff
Showing 1 changed file with 85 additions and 0 deletions.
85 changes: 85 additions & 0 deletions .guthub/workflows/o365release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: O365 Release

on:
release:
types: [published]

jobs:
release_zip_file:
name: Prepare release asset
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v1

- name: switching from HTTPS to SSH
run: git remote set-url origin git@github.com:RogerSelwyn/O365-HomeAssistant.git
- name: Update requirements.txt
run: python3 /home/runner/work/O365-HomeAssistant/O365-HomeAssistant/manage/update_requirements.py
- name: check for changes
run: git status
- name: stage changed files
run: git add requirements.txt
- name: commit changed files
continue-on-error: true
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -m "Auto update requirements.txt"
- name: Update manifest.json
run: python3 /home/runner/work/O365-HomeAssistant/O365-HomeAssistant/manage/update_version.py --tag ${{ github.ref }}
- name: check for changes
run: git status
- name: stage changed files
run: git add ./custom_components/o365/manifest.json
- name: commit changed files
continue-on-error: true
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -m "Auto update manifest.json"
git tag -fa ${{ github.event.release.tag_name }} -m "Update version number ${{ github.event.release.tag_name }}"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Push tag change
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
force: true
tags: true
# Pack the O365 dir as a zip and upload to the release
- name: ZIP O365 Dir
run: |
cd /home/runner/work/O365-HomeAssistant/O365-HomeAssistant/custom_components/o365
zip o365.zip -r ./
- name: Upload zip to release
uses: svenstaro/upload-release-action@v1-release

with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: /home/runner/work/O365-HomeAssistant/O365-HomeAssistant/custom_components/o365/o365.zip
asset_name: o365.zip
tag: ${{ github.ref }}
overwrite: true

releasenotes:
name: Prepare release notes
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v1

- name: Enable version 3.7 of Python
uses: actions/setup-python@v1
with:
python-version: 3.7

- name: Install requirements
run: |
python3 -m pip install setuptools wheel
python3 -m pip install -r /home/runner/work/O365-HomeAssistant/O365-HomeAssistant/requirements_release.txt
- name: Update release notes
run: python3 /home/runner/work/O365-HomeAssistant/O365-HomeAssistant/manage/generate_releasenotes.py --token ${{ secrets.GITHUB_TOKEN }} --release yes --tag ${{ github.ref }}

0 comments on commit b1182ff

Please sign in to comment.