From 7e978e5bf1adf0833886f093a31d0245a874be76 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Thu, 7 Dec 2023 21:43:30 -0500 Subject: [PATCH] ci: automated rolling releases --- .github/ISSUE_TEMPLATE/bug-report.yml | 45 ------ .github/ISSUE_TEMPLATE/config.yml | 13 -- .github/workflows/CI.yml | 115 +++++++--------- .github/workflows/ci-docker.yml | 161 +++++++++------------- .github/workflows/localize.yml | 4 +- CHANGELOG.md | 7 - README.rst | 4 +- docs/source/about/changelog.rst | 17 +++ docs/source/conf.py | 21 ++- docs/source/contributing/localization.rst | 6 +- docs/source/pyra_docs/version.rst | 7 - docs/source/toc.rst | 2 +- pyra/version.py | 22 --- retroarcher.py | 3 +- tests/unit/test_version.py | 22 --- 15 files changed, 156 insertions(+), 293 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug-report.yml delete mode 100644 .github/ISSUE_TEMPLATE/config.yml delete mode 100644 CHANGELOG.md create mode 100644 docs/source/about/changelog.rst delete mode 100644 docs/source/pyra_docs/version.rst delete mode 100644 pyra/version.py delete mode 100644 tests/unit/test_version.py diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml deleted file mode 100644 index cbec1ede5..000000000 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ /dev/null @@ -1,45 +0,0 @@ ---- -name: Bug Report -description: Create a bug report to help us improve. -body: - - type: markdown - attributes: - value: > - **THIS IS NOT THE PLACE TO ASK FOR SUPPORT!** - Please use our [Support Center](https://app.lizardbyte.dev/support) for support issues. - - type: textarea - id: description - attributes: - label: Describe the Bug - description: A clear and concise description of the bug. - validations: - required: true - - type: textarea - id: expected - attributes: - label: Expected Behavior - description: A clear and concise description of what you expected to happen. - - type: textarea - id: additional - attributes: - label: Additional Context - description: Add any other context about the bug here. - - type: input - id: os_server - attributes: - label: RetroArcher Server Operating System and Version - placeholder: eg. Windows 10, macOS 10.15, Ubuntu 20.04, etc. - validations: - required: true - - type: input - id: retroarcher - attributes: - label: RetroArcher Version - placeholder: eg. 1.1.1 - validations: - required: true - - type: markdown - attributes: - value: | - Make sure to close your issue when it's solved! If you found the solution yourself please comment so that - others benefit from it. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index 3371de065..000000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -# This action is centrally managed in https://github.com//.github/ -# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in -# the above-mentioned repo. - -blank_issues_enabled: false -contact_links: - - name: Support Center - url: https://app.lizardbyte.dev/support - about: Official LizardByte support - - name: Feature request - url: https://app.lizardbyte.dev/feedback - about: Share your suggestions or ideas to help us improve diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 7d00d656b..01bb24619 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -3,69 +3,50 @@ name: CI on: pull_request: - branches: [master, nightly] + branches: [master] types: [opened, synchronize, reopened] push: - branches: [master, nightly] + branches: [master] workflow_dispatch: -jobs: - check_changelog: - name: Check Changelog - runs-on: ubuntu-latest - steps: - - name: Checkout - if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }} - 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 - with: - token: ${{ secrets.GITHUB_TOKEN }} +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: + setup_release: + name: Setup Release 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 }} - - version_check: + 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 - needs: check_changelog - steps: - name: Checkout - if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }} uses: actions/checkout@v4 - - name: Install Python - if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }} - uses: actions/setup-python@v5 + - name: Setup Release + id: setup_release + uses: LizardByte/setup-release-action@v2023.1207.150459 with: - python-version: '3.9' - - - name: Set up Python Dependencies - if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }} - run: | - echo "Installing RetroArcher Requirements" - python -m pip install --upgrade pip setuptools - python -m pip install -r requirements.txt --no-warn-script-location - - - name: Get version - if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }} - run: | - OUTPUT=$(python ./retroarcher.py --version) - echo "pyra_version=${OUTPUT}" >> $GITHUB_ENV - - - name: Compare versions - if: ( env.pyra_version != needs.check_changelog.outputs.next_version ) && ( github.ref == 'refs/heads/master' || github.base_ref == 'master' ) # yamllint disable-line rule:line-length - run: | - echo "Version number in pyra/version.py does not match version in CHANGELOG.md" - exit 1 + github_token: ${{ secrets.GITHUB_TOKEN }} build: + needs: + - setup_release + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -75,9 +56,6 @@ jobs: - os: windows-2019 architecture: x86 - runs-on: ${{ matrix.os }} - needs: [check_changelog, version_check] - steps: - name: Checkout uses: actions/checkout@v4 @@ -115,28 +93,31 @@ jobs: run: | python ./scripts/build.py + - name: Package Release + run: | + 7z a "./RetroArcher_${{ runner.os }}_${{ matrix.architecture }}.zip" "dist" + + mkdir artifacts + mv "./RetroArcher_${{ runner.os }}_${{ matrix.architecture }}.zip" ./artifacts/ + - name: Upload Artifacts - if: ${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' }} uses: actions/upload-artifact@v3 # https://github.com/actions/upload-artifact with: name: RetroArcher_${{ runner.os }}_${{ matrix.architecture }} if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` path: | - ${{ github.workspace }}/dist - - - name: Package Release - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} - run: | - 7z a "./RetroArcher_${{ runner.os }}_${{ matrix.architecture }}.zip" "dist" + ${{ github.workspace }}/artifacts - name: Create/Update GitHub Release - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} - uses: ncipollo/release-action@v1 # https://github.com/ncipollo/release-action + if: ${{ needs.setup_release.outputs.publish_release == 'true' }} + uses: LizardByte/create-release-action@v2023.1128.2625 with: - name: ${{ needs.check_changelog.outputs.next_version }} - tag: ${{ needs.check_changelog.outputs.next_version }} - artifacts: "*.zip" - token: ${{ secrets.GH_PAT }} allowUpdates: true - body: ${{ needs.check_changelog.outputs.release_body }} - discussionCategory: Announcements + 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 }} diff --git a/.github/workflows/ci-docker.yml b/.github/workflows/ci-docker.yml index edeeb2bd9..3950915d0 100644 --- a/.github/workflows/ci-docker.yml +++ b/.github/workflows/ci-docker.yml @@ -74,82 +74,60 @@ jobs: echo $matrix | jq . echo "matrix=$matrix" >> $GITHUB_OUTPUT + - name: Find dotnet solution file + id: find_dotnet + run: | + solution=$(find . -maxdepth 1 -type f -iname "*.sln") + + echo "found solution: ${solution}" + + # do not quote to keep this as a single line + echo solution=${solution} >> $GITHUB_OUTPUT + + if [[ $solution != "" ]]; then + echo "dotnet=true" >> $GITHUB_OUTPUT + else + echo "dotnet=false" >> $GITHUB_OUTPUT + fi + outputs: dockerfiles: ${{ steps.find.outputs.dockerfiles }} matrix: ${{ steps.find.outputs.matrix }} + dotnet: ${{ steps.find_dotnet.outputs.dotnet }} + solution: ${{ steps.find_dotnet.outputs.solution }} - check_changelog: - name: Check Changelog - needs: [check_dockerfiles] + setup_release: if: ${{ needs.check_dockerfiles.outputs.dockerfiles }} + name: Setup Release + needs: + - check_dockerfiles + 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 - if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' }} 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/setup-release-action@v2023.1207.150459 with: - token: ${{ secrets.GITHUB_TOKEN }} - outputs: - next_version: ${{ steps.verify_changelog.outputs.changelog_parser_version }} - next_version_bare: ${{ steps.verify_changelog.outputs.changelog_parser_version_bare }} - last_version: ${{ steps.verify_changelog.outputs.latest_release_tag_name }} - release_body: ${{ steps.verify_changelog.outputs.changelog_parser_description }} - - setup_release: - name: Setup Release - needs: check_changelog - runs-on: ubuntu-latest - steps: - - name: Set release details - id: release_details - env: - RELEASE_BODY: ${{ needs.check_changelog.outputs.release_body }} - run: | - # determine to create a release or not - if [[ $GITHUB_EVENT_NAME == "push" ]]; then - RELEASE=true - else - RELEASE=false - fi - - # set the release tag - COMMIT=${{ github.sha }} - if [[ $GITHUB_REF == refs/heads/master ]]; then - TAG="${{ needs.check_changelog.outputs.next_version }}" - RELEASE_NAME="${{ needs.check_changelog.outputs.next_version }}" - RELEASE_BODY="$RELEASE_BODY" - PRE_RELEASE="false" - elif [[ $GITHUB_REF == refs/heads/nightly ]]; then - TAG="nightly-dev" - RELEASE_NAME="nightly" - RELEASE_BODY="automated nightly release - $(date -u +'%Y-%m-%dT%H:%M:%SZ') - ${COMMIT}" - PRE_RELEASE="true" - fi - - echo "create_release=${RELEASE}" >> $GITHUB_OUTPUT - echo "release_tag=${TAG}" >> $GITHUB_OUTPUT - echo "release_commit=${COMMIT}" >> $GITHUB_OUTPUT - echo "release_name=${RELEASE_NAME}" >> $GITHUB_OUTPUT - echo "pre_release=${PRE_RELEASE}" >> $GITHUB_OUTPUT - - # this is stupid but works for multiline strings - echo "RELEASE_BODY<> $GITHUB_ENV - echo "$RELEASE_BODY" >> $GITHUB_ENV - echo "EOF" >> $GITHUB_ENV - - outputs: - create_release: ${{ steps.release_details.outputs.create_release }} - release_tag: ${{ steps.release_details.outputs.release_tag }} - release_commit: ${{ steps.release_details.outputs.release_commit }} - release_name: ${{ steps.release_details.outputs.release_name }} - release_body: ${{ env.RELEASE_BODY }} - pre_release: ${{ steps.release_details.outputs.pre_release }} + dotnet: ${{ needs.check_dockerfiles.outputs.dotnet }} + github_token: ${{ secrets.GITHUB_TOKEN }} lint_dockerfile: needs: [check_dockerfiles] @@ -180,7 +158,7 @@ jobs: cat "./hadolint.log" >> $GITHUB_STEP_SUMMARY docker: - needs: [check_dockerfiles, check_changelog, setup_release] + needs: [check_dockerfiles, setup_release] if: ${{ needs.check_dockerfiles.outputs.dockerfiles }} runs-on: ubuntu-latest permissions: @@ -210,24 +188,20 @@ jobs: - name: Prepare id: prepare env: - NV: ${{ needs.check_changelog.outputs.next_version }} + NV: ${{ needs.setup_release.outputs.release_tag }} run: | # get branch name BRANCH=${GITHUB_HEAD_REF} - RELEASE=false + RELEASE=${{ needs.setup_release.outputs.publish_release }} + COMMIT=${{ needs.setup_release.outputs.release_commit }} if [ -z "$BRANCH" ]; then echo "This is a PUSH event" BRANCH=${{ github.ref_name }} - COMMIT=${{ github.sha }} CLONE_URL=${{ github.event.repository.clone_url }} - if [[ $BRANCH == "master" ]]; then - RELEASE=true - fi else echo "This is a PULL REQUEST event" - COMMIT=${{ github.event.pull_request.head.sha }} CLONE_URL=${{ github.event.pull_request.head.repo.clone_url }} fi @@ -260,7 +234,7 @@ jobs: # parse custom directives out of dockerfile # try to get the platforms from the dockerfile custom directive, i.e. `# platforms: xxx,yyy` # directives for PR event, i.e. not push event - if [[ ${PUSH} == "false" ]]; then + if [[ ${RELEASE} == "false" ]]; then while read -r line; do if [[ $line == "# platforms_pr: "* && $PLATFORMS == "" ]]; then # echo the line and use `sed` to remove the custom directive @@ -299,13 +273,10 @@ jobs: echo "branch=${BRANCH}" >> $GITHUB_OUTPUT echo "build_date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT - echo "commit=${COMMIT}" >> $GITHUB_OUTPUT echo "clone_url=${CLONE_URL}" >> $GITHUB_OUTPUT - echo "release=${RELEASE}" >> $GITHUB_OUTPUT echo "artifacts=${ARTIFACTS}" >> $GITHUB_OUTPUT echo "no_cache_filters=${NO_CACHE_FILTERS}" >> $GITHUB_OUTPUT echo "platforms=${PLATFORMS}" >> $GITHUB_OUTPUT - echo "push=${PUSH}" >> $GITHUB_OUTPUT echo "tags=${TAGS}" >> $GITHUB_OUTPUT - name: Set Up QEMU @@ -324,14 +295,14 @@ jobs: Docker-buildx${{ matrix.tag }}- - name: Log in to Docker Hub - if: ${{ steps.prepare.outputs.push == 'true' }} # PRs do not have access to secrets + if: ${{ needs.setup_release.outputs.publish_release == 'true' }} # PRs do not have access to secrets uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - name: Log in to the Container registry - if: ${{ steps.prepare.outputs.push == 'true' }} # PRs do not have access to secrets + if: ${{ needs.setup_release.outputs.publish_release == 'true' }} # PRs do not have access to secrets uses: docker/login-action@v3 with: registry: ghcr.io @@ -352,10 +323,10 @@ jobs: build-args: | BRANCH=${{ steps.prepare.outputs.branch }} BUILD_DATE=${{ steps.prepare.outputs.build_date }} - BUILD_VERSION=${{ needs.check_changelog.outputs.next_version }} - COMMIT=${{ steps.prepare.outputs.commit }} + BUILD_VERSION=${{ needs.setup_release.outputs.release_tag }} + COMMIT=${{ needs.setup_release.outputs.release_commit }} CLONE_URL=${{ steps.prepare.outputs.clone_url }} - RELEASE=${{ steps.prepare.outputs.release }} + RELEASE=${{ needs.setup_release.outputs.publish_release }} tags: ${{ steps.prepare.outputs.tags }} cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache @@ -367,15 +338,15 @@ jobs: with: context: ./ file: ${{ matrix.dockerfile }} - push: ${{ steps.prepare.outputs.push }} + push: ${{ needs.setup_release.outputs.publish_release }} platforms: ${{ steps.prepare.outputs.platforms }} build-args: | BRANCH=${{ steps.prepare.outputs.branch }} BUILD_DATE=${{ steps.prepare.outputs.build_date }} - BUILD_VERSION=${{ needs.check_changelog.outputs.next_version }} - COMMIT=${{ steps.prepare.outputs.commit }} + BUILD_VERSION=${{ needs.setup_release.outputs.release_tag }} + COMMIT=${{ needs.setup_release.outputs.release_commit }} CLONE_URL=${{ steps.prepare.outputs.clone_url }} - RELEASE=${{ steps.prepare.outputs.release }} + RELEASE=${{ needs.setup_release.outputs.publish_release }} tags: ${{ steps.prepare.outputs.tags }} cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache @@ -401,18 +372,18 @@ jobs: path: artifacts/ - name: Create/Update GitHub Release - if: ${{ needs.setup_release.outputs.create_release == 'true' && steps.prepare.outputs.artifacts == 'true' }} - uses: ncipollo/release-action@v1 + if: ${{ needs.setup_release.outputs.publish_release == 'true' && steps.prepare.outputs.artifacts == 'true' }} + uses: LizardByte/create-release-action@v2023.1128.2625 with: - name: ${{ needs.setup_release.outputs.release_name }} - tag: ${{ needs.setup_release.outputs.release_tag }} - commit: ${{ needs.setup_release.outputs.release_commit }} - artifacts: "*artifacts/*" - token: ${{ secrets.GH_BOT_TOKEN }} allowUpdates: true - body: ${{ needs.setup_release.outputs.release_body }} + artifacts: "*artifacts/*" + body: '' discussionCategory: announcements - prerelease: ${{ needs.setup_release.outputs.pre_release }} + generateReleaseNotes: true + name: ${{ needs.setup_release.outputs.release_tag }} + prerelease: ${{ needs.setup_release.outputs.publish_pre_release }} + tag: ${{ needs.setup_release.outputs.release_tag }} + token: ${{ secrets.GH_BOT_TOKEN }} - name: Update Docker Hub Description if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} diff --git a/.github/workflows/localize.yml b/.github/workflows/localize.yml index e19de4caf..fd725b596 100644 --- a/.github/workflows/localize.yml +++ b/.github/workflows/localize.yml @@ -3,7 +3,7 @@ name: localize on: push: - branches: [nightly] + branches: [master] paths: # prevents workflow from running unless these files change - '.github/workflows/localize.yml' - 'retroarcher.py' @@ -65,7 +65,7 @@ jobs: commit-message: New localization template branch: localize/update delete-branch: true - base: nightly + base: master title: New Babel Updates body: | Update report diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 84a857406..000000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,7 +0,0 @@ -# Changelog - -## [0.1.0] - 2022-04-16 -### Added -- Initial release, for development use only at this point. - -[0.1.0]: https://github.com/retroarcher/retroarcher/releases/tag/v0.1.0 diff --git a/README.rst b/README.rst index 7886cacb3..1234d3fef 100644 --- a/README.rst +++ b/README.rst @@ -12,9 +12,9 @@ Integrations :alt: GitHub Workflow Status (CI) :target: https://github.com/LizardByte/RetroArcher/actions/workflows/CI.yml?query=branch%3Amaster -.. image:: https://img.shields.io/github/actions/workflow/status/lizardbyte/retroarcher/localize.yml.svg?branch=nightly&label=localize%20build&logo=github&style=for-the-badge +.. image:: https://img.shields.io/github/actions/workflow/status/lizardbyte/retroarcher/localize.yml.svg?branch=master&label=localize%20build&logo=github&style=for-the-badge :alt: GitHub Workflow Status (localize) - :target: https://github.com/LizardByte/RetroArcher/actions/workflows/localize.yml?query=branch%3Anightly + :target: https://github.com/LizardByte/RetroArcher/actions/workflows/localize.yml?query=branch%3Amaster .. image:: https://img.shields.io/readthedocs/retroarcher?label=Docs&style=for-the-badge&logo=readthedocs :alt: Read the Docs diff --git a/docs/source/about/changelog.rst b/docs/source/about/changelog.rst new file mode 100644 index 000000000..9f0d0b573 --- /dev/null +++ b/docs/source/about/changelog.rst @@ -0,0 +1,17 @@ +Changelog +========= + +.. only:: epub + + You can view the changelog in the + `online version `__. + +.. only:: html + + .. raw:: html + + + + diff --git a/docs/source/conf.py b/docs/source/conf.py index 653735c2a..d86d65546 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -23,17 +23,17 @@ try: sys.path.insert(0, root_dir) from pyra import definitions # put this in a try/except to prevent flake8 warning - from pyra import version except Exception: sys.exit(1) # -- Project information ----------------------------------------------------- project = definitions.Names().name -copyright = f'{datetime.now ().year}, {project}' +project_copyright = f'{datetime.now ().year}, {project}' author = 'ReenigneArcher' # The full version, including alpha/beta/rc tags -version = version.version +# https://docs.readthedocs.io/en/stable/reference/environment-variables.html#envvar-READTHEDOCS_VERSION +version = os.getenv('READTHEDOCS_VERSION', 'dirty') # -- General configuration --------------------------------------------------- @@ -64,12 +64,23 @@ # -- Options for HTML output ------------------------------------------------- +# images +html_favicon = os.path.join(definitions.Paths().ROOT_DIR, 'web', 'images', 'retroarcher.ico') +html_logo = os.path.join(definitions.Paths().ROOT_DIR, 'web', 'images', 'logo-circle.png') + # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". # html_static_path = ['_static'] -html_logo = os.path.join(definitions.Paths().ROOT_DIR, 'web', 'images', 'logo-circle.png') +# 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. @@ -77,7 +88,7 @@ html_theme_options = { "top_of_page_button": "edit", - "source_edit_link": "https://github.com/lizardbyte/retroarcher/tree/nightly/docs/source/{filename}", + "source_edit_link": "https://github.com/lizardbyte/retroarcher/blob/master/docs/source/{filename}", } # extension config options diff --git a/docs/source/contributing/localization.rst b/docs/source/contributing/localization.rst index 89ca32467..e8108585f 100644 --- a/docs/source/contributing/localization.rst +++ b/docs/source/contributing/localization.rst @@ -31,8 +31,8 @@ Translations Basics When a change is made to retroarcher python source or web templates, a workflow generates new translation templates that get pushed to CrowdIn automatically. - When translations are updated on CrowdIn, a push gets made to the `l10n_nightly` branch and a PR is made against the - `nightly` branch. Once PR is merged, all updated translations are part of the project and will be included in the + When translations are updated on CrowdIn, a push gets made to the `l10n_master` branch and a PR is made against the + `master` branch. Once PR is merged, all updated translations are part of the project and will be included in the next release. Extraction @@ -71,7 +71,7 @@ extraction method from html templates is very similar to extracting from python Strings are automatically extracted from the code to the `locale/retroarcher.po` template file. The generated file is used by CrowdIn to generate language specific template files. The file is generated using the -`.github/workflows/localize.yml` workflow and is run on any push event into the `nightly` branch. Jobs are only run if +`.github/workflows/localize.yml` workflow and is run on any push event into the `master` branch. Jobs are only run if any of the following paths are modified. .. code-block:: yaml diff --git a/docs/source/pyra_docs/version.rst b/docs/source/pyra_docs/version.rst deleted file mode 100644 index d5fbe5cf4..000000000 --- a/docs/source/pyra_docs/version.rst +++ /dev/null @@ -1,7 +0,0 @@ -.. include:: ../global.rst - -:modname:`pyra.version` ------------------------ -.. automodule:: pyra.version - :members: - :show-inheritance: diff --git a/docs/source/toc.rst b/docs/source/toc.rst index a15c4c345..c03f6a46a 100644 --- a/docs/source/toc.rst +++ b/docs/source/toc.rst @@ -7,6 +7,7 @@ about/usage about/docker about/build + about/changelog .. toctree:: :maxdepth: 2 @@ -31,5 +32,4 @@ pyra_docs/logger pyra_docs/threads pyra_docs/tray_icon - pyra_docs/version pyra_docs/webapp diff --git a/pyra/version.py b/pyra/version.py deleted file mode 100644 index edfe87650..000000000 --- a/pyra/version.py +++ /dev/null @@ -1,22 +0,0 @@ -""" -.. - version.py - -Module containing constants related to version numbers. - -Constants ---------- -version : str - Semantic version of RetroArcher. i.e. `0.1.0` - -Examples --------- ->>> version -0.1.0 -""" - -_version_major = 0 -_version_minor = 1 -_version_patch = 0 - -version = f'{_version_major}.{_version_minor}.{_version_patch}' diff --git a/retroarcher.py b/retroarcher.py index 0672c554c..08502cd8d 100644 --- a/retroarcher.py +++ b/retroarcher.py @@ -23,7 +23,6 @@ from pyra import locales from pyra import logger from pyra import threads -from pyra import version py_name = 'pyra' @@ -146,7 +145,7 @@ def main(): sys.exit(exit_code) if args.version: - print(f'v{version.version}') + print('version arg is not yet implemented') sys.exit() if args.config: diff --git a/tests/unit/test_version.py b/tests/unit/test_version.py deleted file mode 100644 index b62e62e62..000000000 --- a/tests/unit/test_version.py +++ /dev/null @@ -1,22 +0,0 @@ -""" -.. - test_version.py - -Unit tests for pyra.version. -""" -# local imports -from pyra import version - - -def test_run_in_thread(): - """Tests that a proper version number is returned.""" - test_version_major = version._version_major - test_version_minor = version._version_minor - test_version_patch = version._version_patch - - assert isinstance(test_version_major, int) - assert isinstance(test_version_minor, int) - assert isinstance(test_version_patch, int) - - test_version = version.version - assert test_version == f'{test_version_major}.{test_version_minor}.{test_version_patch}'