Skip to content
This repository has been archived by the owner on Aug 9, 2024. It is now read-only.

Commit

Permalink
ci: automated rolling releases
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher committed Dec 7, 2023
1 parent 0768401 commit 3f16fb9
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 58 deletions.
86 changes: 46 additions & 40 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,39 @@ concurrency:
cancel-in-progress: true

jobs:
check_changelog:
name: Check Changelog
setup_release:
name: Setup Release
outputs:
changelog_changes: ${{ steps.setup_release.outputs.changelog_changes }}
changelog_date: ${{ steps.setup_release.outputs.changelog_date }}
changelog_exists: ${{ steps.setup_release.outputs.changelog_exists }}
changelog_release_exists: ${{ steps.setup_release.outputs.changelog_release_exists }}
changelog_url: ${{ steps.setup_release.outputs.changelog_url }}
changelog_version: ${{ steps.setup_release.outputs.changelog_version }}
publish_pre_release: ${{ steps.setup_release.outputs.publish_pre_release }}
publish_release: ${{ steps.setup_release.outputs.publish_release }}
publish_stable_release: ${{ steps.setup_release.outputs.publish_stable_release }}
release_body: ${{ steps.setup_release.outputs.release_body }}
release_build: ${{ steps.setup_release.outputs.release_build }}
release_commit: ${{ steps.setup_release.outputs.release_commit }}
release_generate_release_notes: ${{ steps.setup_release.outputs.release_generate_release_notes }}
release_tag: ${{ steps.setup_release.outputs.release_tag }}
release_version: ${{ steps.setup_release.outputs.release_version }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Verify Changelog
id: verify_changelog
if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }}
# base_ref for pull request check, ref for push
uses: LizardByte/.github/actions/verify_changelog@master
- name: Setup Release
id: setup_release
uses: LizardByte/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
outputs:
next_version: ${{ steps.verify_changelog.outputs.changelog_parser_version }}
last_version: ${{ steps.verify_changelog.outputs.latest_release_tag_name }}
release_body: ${{ steps.verify_changelog.outputs.changelog_parser_description }}
github_token: ${{ secrets.GITHUB_TOKEN }}

build:
needs:
- setup_release
runs-on: ubuntu-20.04
needs: check_changelog

steps:
- name: Checkout
Expand All @@ -49,6 +60,7 @@ jobs:
python-version: '2.7'

- name: Set up Python Dependencies
shell: bash
working-directory: RetroArcher-plex.bundle
run: |
echo "Installing Requirements"
Expand All @@ -64,37 +76,18 @@ jobs:
- name: Build plist
working-directory: RetroArcher-plex.bundle
env:
BUILD_VERSION: ${{ needs.check_changelog.outputs.next_version }}
BUILD_VERSION: ${{ needs.setup_release.outputs.release_tag }}
run: |
python scripts/build_plist.py
- name: Test Plex Agent
# todo - replace with pytest
working-directory: RetroArcher-plex.bundle
run: |
python ./Contents/Code/__init__.py
- name: Upload Artifacts
if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }}
uses: actions/upload-artifact@v3
with:
name: RetroArcher-plex.bundle
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
path: |
${{ github.workspace }}
!**/*.git*
!**/*.pyc
!**/__pycache__
!**/plexhints*
!**/RetroArcher-plex.bundle/.*
!**/RetroArcher-plex.bundle/cache.sqlite
!**/RetroArcher-plex.bundle/DOCKER_README.md
!**/RetroArcher-plex.bundle/Dockerfile
!**/RetroArcher-plex.bundle/docs
!**/RetroArcher-plex.bundle/scripts
- name: Package Release
shell: bash
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
run: |
7z \
"-xr!*.git*" \
Expand All @@ -112,11 +105,24 @@ jobs:
mkdir artifacts
mv ./RetroArcher-plex.bundle.zip ./artifacts/
- name: Create Release
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
uses: LizardByte/.github/actions/create_release@master
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: RetroArcher-plex.bundle
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
path: |
${{ github.workspace }}/artifacts
- name: Create/Update GitHub Release
if: ${{ needs.setup_release.outputs.publish_release == 'true' }}
uses: LizardByte/[email protected]
with:
allowUpdates: true
body: ''
discussionCategory: announcements
generateReleaseNotes: true
name: ${{ needs.setup_release.outputs.release_tag }}
# use pre-release for now
prerelease: true # ${{ needs.setup_release.outputs.publish_pre_release }}
tag: ${{ needs.setup_release.outputs.release_tag }}
token: ${{ secrets.GH_BOT_TOKEN }}
next_version: ${{ needs.check_changelog.outputs.next_version }}
last_version: ${{ needs.check_changelog.outputs.last_version }}
release_body: ${{ needs.check_changelog.outputs.release_body }}
7 changes: 0 additions & 7 deletions CHANGELOG.md

This file was deleted.

2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
:github_url: https://github.com/LizardByte/RetroArcher-plex/tree/nightly/README.rst
:github_url: https://github.com/LizardByte/RetroArcher-plex/blob/master/README.rst

Overview
========
Expand Down
18 changes: 17 additions & 1 deletion docs/source/about/changelog.rst
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
.. mdinclude:: ../../../CHANGELOG.md
Changelog
=========

.. only:: epub

You can view the changelog in the
`online version <https://github.com/LizardByte/RetroArcher-plex/changelog/CHANGELOG.md>`__.

.. only:: html

.. raw:: html

<script type="module" src="https://md-block.verou.me/md-block.js"></script>
<md-block
hmin="2"
src="https://raw.githubusercontent.com/LizardByte/RetroArcher-plex/changelog/CHANGELOG.md">
</md-block>
2 changes: 1 addition & 1 deletion docs/source/code_docs/helpers.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
:github_url: https://github.com/LizardByte/RetroArcher-plex/tree/nightly/Contents/Code/helpers.py
:github_url: https://github.com/LizardByte/RetroArcher-plex/blob/master/Contents/Code/helpers.py

.. include:: ../global.rst

Expand Down
2 changes: 1 addition & 1 deletion docs/source/code_docs/main.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
:github_url: https://github.com/LizardByte/RetroArcher-plex/tree/nightly/Contents/Code/__init__.py
:github_url: https://github.com/LizardByte/RetroArcher-plex/blob/master/Contents/Code/__init__.py

.. include:: ../global.rst

Expand Down
14 changes: 11 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# standard imports
from datetime import datetime
import os
import re
import sys


Expand Down Expand Up @@ -37,8 +36,8 @@
author = 'ReenigneArcher'

# The full version, including alpha/beta/rc tags
with open(os.path.join(root_dir, 'CHANGELOG.md'), 'r') as f:
version = re.search(r"\[((\d+)\.(\d+)\.(\d+))]", str(f.read())).group(1)
# https://docs.readthedocs.io/en/stable/reference/environment-variables.html#envvar-READTHEDOCS_VERSION
version = os.getenv('READTHEDOCS_VERSION', 'dirty')


# -- General configuration ---------------------------------------------------
Expand Down Expand Up @@ -80,6 +79,15 @@
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = ['_static']

# These paths are either relative to html_static_path
# or fully qualified paths (eg. https://...)
# html_css_files = [
# 'css/custom.css',
# ]
# html_js_files = [
# 'js/custom.js',
# ]

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'sphinx_rtd_theme'
Expand Down
2 changes: 1 addition & 1 deletion docs/source/contributing/build.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
:github_url: https://github.com/LizardByte/RetroArcher-plex/tree/nightly/docs/source/contributing/build.rst
:github_url: https://github.com/LizardByte/RetroArcher-plex/blob/master/docs/source/contributing/build.rst

Build
=====
Expand Down
2 changes: 1 addition & 1 deletion docs/source/contributing/contributing.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
:github_url: https://github.com/LizardByte/RetroArcher-plex/tree/nightly/docs/source/contributing/contributing.rst
:github_url: https://github.com/LizardByte/RetroArcher-plex/blob/master/docs/source/contributing/contributing.rst

Contributing
============
Expand Down
2 changes: 1 addition & 1 deletion docs/source/contributing/testing.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
:github_url: https://github.com/LizardByte/RetroArcher-plex/tree/nightly/docs/source/contributing/testing.rst
:github_url: https://github.com/LizardByte/RetroArcher-plex/blob/master/docs/source/contributing/testing.rst

Testing
=======
Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
:github_url: https://github.com/LizardByte/RetroArcher/tree/nightly/docs/source/index.rst
:github_url: https://github.com/LizardByte/RetroArcher/blob/master/docs/source/index.rst

RetroArcher has this documentation hosted on `Read the Docs <http://retroarcher.readthedocs.io/>`__.

Expand Down

0 comments on commit 3f16fb9

Please sign in to comment.