Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: 2bndy5/rmskin-action
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.1.3
Choose a base ref
...
head repository: 2bndy5/rmskin-action
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Jul 11, 2020

  1. Copy the full SHA
    1427db8 View commit details

Commits on Dec 11, 2020

  1. bad indent in action.yml

    2bndy5 committed Dec 11, 2020
    Copy the full SHA
    27a9f3a View commit details
  2. Copy the full SHA
    f39083b View commit details

Commits on Jul 25, 2021

  1. Copy the full SHA
    dcf5d69 View commit details
  2. Update main.yml

    2bndy5 committed Jul 25, 2021
    Copy the full SHA
    3df1c79 View commit details
  3. use relative path input

    2bndy5 committed Jul 25, 2021
    Copy the full SHA
    30ee6b5 View commit details
  4. Copy the full SHA
    3cb5f0e View commit details
  5. better code reuse

    2bndy5 committed Jul 25, 2021
    Copy the full SHA
    de46f06 View commit details
  6. Copy the full SHA
    15c73a2 View commit details
  7. [no ci] ran black

    2bndy5 committed Jul 25, 2021
    Copy the full SHA
    8cb522a View commit details
  8. ready for release to pypi

    2bndy5 committed Jul 25, 2021
    Copy the full SHA
    399d521 View commit details
  9. Copy the full SHA
    d1aadde View commit details
  10. oops too much c-n-p

    2bndy5 committed Jul 25, 2021
    Copy the full SHA
    aa843f2 View commit details
  11. update README

    2bndy5 committed Jul 25, 2021
    Copy the full SHA
    dbf2d3d View commit details
  12. [no ci] wrong badge src/link

    2bndy5 committed Jul 25, 2021
    Copy the full SHA
    e877272 View commit details
  13. [no ci] fix typos in readme

    2bndy5 committed Jul 25, 2021
    Copy the full SHA
    46f2f31 View commit details

Commits on Jul 26, 2021

  1. add a badge

    2bndy5 authored Jul 26, 2021
    Copy the full SHA
    a0c93a2 View commit details

Commits on Jan 14, 2023

  1. Copy the full SHA
    9aa08ca View commit details
  2. update README

    2bndy5 committed Jan 14, 2023
    Copy the full SHA
    5254c20 View commit details

Commits on Sep 28, 2023

  1. Use dependabot (#2)

    for github actions updates
    2bndy5 authored Sep 28, 2023
    Copy the full SHA
    3eb2dfb View commit details
  2. Bump actions/checkout from 3 to 4 (#3)

    Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
    - [Release notes](https://github.com/actions/checkout/releases)
    - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
    - [Commits](actions/checkout@v3...v4)
    
    ---
    updated-dependencies:
    - dependency-name: actions/checkout
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Sep 28, 2023
    Copy the full SHA
    7c7f5db View commit details

Commits on Sep 29, 2023

  1. Switch to composite action (#4)

    * switch to composite action
    * migrate to pyproject.toml
    * add pre-commit config and use it in CI
    * add unit testing and type checking
    * use windows CI runner for accurate testing
    * add .gitattributes & allow crlf in demo test files
    2bndy5 authored Sep 29, 2023
    Copy the full SHA
    791b892 View commit details
  2. use powershell instead of bash

    2bndy5 committed Sep 29, 2023
    Copy the full SHA
    c9b65bd View commit details
  3. invoke module as exe script

    add coverage badge to README
    2bndy5 committed Sep 29, 2023
    Copy the full SHA
    4346dcd View commit details
  4. using pathlib more

    2bndy5 committed Sep 29, 2023
    Copy the full SHA
    f9a09e1 View commit details
  5. Copy the full SHA
    ce361cb View commit details
  6. Copy the full SHA
    a520e5d View commit details
  7. setuptools_scm uses git full history for packaging

    changes to master branch are  uploaded as nightly builds to test-pypi
    2bndy5 committed Sep 29, 2023
    Copy the full SHA
    6b222cc View commit details
  8. fix upload to test-pypi

    2bndy5 committed Sep 29, 2023
    Copy the full SHA
    dc59a8d View commit details
  9. try fixing cache path in CI

    2bndy5 committed Sep 29, 2023
    Copy the full SHA
    2cb6873 View commit details
  10. Ci fixes (#5)

    * include python version in cache key
    * fix step summary usage for coverage report
    2bndy5 authored Sep 29, 2023
    Copy the full SHA
    7d39c47 View commit details

Commits on Oct 12, 2023

  1. Copy the full SHA
    342a85a View commit details

Commits on Dec 11, 2023

  1. Bump actions/setup-python from 4 to 5 (#6)

    Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5.
    - [Release notes](https://github.com/actions/setup-python/releases)
    - [Commits](actions/setup-python@v4...v5)
    
    ---
    updated-dependencies:
    - dependency-name: actions/setup-python
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Dec 11, 2023
    Copy the full SHA
    fc41093 View commit details

Commits on Jan 22, 2024

  1. Bump actions/cache from 3 to 4 (#7)

    Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4.
    - [Release notes](https://github.com/actions/cache/releases)
    - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
    - [Commits](actions/cache@v3...v4)
    
    ---
    updated-dependencies:
    - dependency-name: actions/cache
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Jan 22, 2024
    Copy the full SHA
    d45b82b View commit details
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Prevent line ending conversions by default to avoid problems with binary files.
* -text

# Known text files should have LF line endings.
*.py text eol=lf
*.rst text eol=lf
*.toml text eol=lf
LICENSE text eol=lf
tests/demo_project/RMSKIN.ini text eol=crlf
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions"
# Workflow files stored in the
# default location of `.github/workflows`
directory: "/"
schedule:
interval: "weekly"
84 changes: 69 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -4,30 +4,84 @@ name: CI
# events but only for the master branch
on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]
release:
types: [published]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
jobs:
Python:
runs-on: windows-latest
steps:
- name: Checkout this Repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
id: python-setup
uses: actions/setup-python@v5
with:
python-version: 3.x

- name: Install Workflow Dependencies
run: python3 -m pip install build twine pre-commit -r tests/requirements.txt -r requirements.txt

- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit_${{ steps.python-setup.outputs.python-version }}_${{ hashFiles('.pre-commit-config.yaml') }}

- name: Check formatting
run: pre-commit run --all-files

- name: Get test coverage
run: |
coverage run -m pytest
coverage report --format markdown >> $env:GITHUB_STEP_SUMMARY
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Create Distributions
run: python3 -m build

- name: twine Check
run: twine check dist/*

- name: twine Upload (pypi)
if: github.event_name == 'release'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.pypi_token }}
run: twine upload dist/*

- name: twine Upload (test-pypi)
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }}
run: twine upload --repository testpypi dist/*


Build:
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref_name == 'master'
runs-on: windows-latest
steps:
# Checkout code
- name: Checkout this Repo
uses: actions/checkout@v2

# # print contents of GITHUB_WORKSPACE dir
# - name: verify contents
# run: ls "${{ github.workspace }}"

uses: actions/checkout@v4

# Runs a this repo's action
- name: Run Build action
id: builder
uses: 2bndy5/rmskin-action@master
# with:
# path: ${{ github.workspace }}
with:
path: tests/demo_project

# Use the output from the `builder` step
- name: Print the output path & filename
- name: Print the output filename
run: echo "The output file was ${{ steps.builder.outputs.arc_name }}"
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -123,5 +123,11 @@ dmypy.json
# Pyre type checker
.pyre/

# ruff linter
.ruff_cache/

# vscode folder
.vscode/
.vscode/

# ignore local test's output files
*.rmskin
29 changes: 29 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-toml
- id: check-added-large-files
- id: mixed-line-ending
args: ['--fix=lf']
exclude: "tests/demo_project"
- id: requirements-txt-fixer
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.291
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.9.1
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
hooks:
- id: mypy
additional_dependencies: ['types-Pillow']
11 changes: 0 additions & 11 deletions Dockerfile

This file was deleted.

149 changes: 91 additions & 58 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,88 +1,121 @@

.. image:: https://github.com/2bndy5/rmskin-action/workflows/CI/badge.svg
:target: https://github.com/2bndy5/rmskin-action/actions

.. image:: https://img.shields.io/pypi/v/rmskin-builder.svg
:target: https://pypi.python.org/pypi/rmskin-builder
:alt: latest version on PyPI
.. image:: https://static.pepy.tech/personalized-badge/rmskin-builder?period=total&units=international_system&left_color=grey&right_color=blue&left_text=PyPi%20Downloads
:target: https://pepy.tech/project/rmskin-builder
:alt: pipy download stats
.. image:: https://codecov.io/github/2bndy5/rmskin-action/graph/badge.svg?token=825YGO53XJ
:target: https://codecov.io/github/2bndy5/rmskin-action
:alt: Code Coverage

rmskin-action
=============

A Python-based Github action tool to package a Repository's Rainmeter Content into a validating .rmskin file for Rainmeter's Skin Installer.
A Python-based Github action tool to package a Repository's Rainmeter Content into a validating
.rmskin file for Rainmeter's Skin Installer.

.. important::
If the repository contains a RMSKIN.bmp image to used as a header image in the rmskin package,
then it must be using 24-bit colors. Additionally, if the image is not exactly 400x60, then
this action's python script will resize it accordingly.

rmskin-builder Python package
-----------------------------

.. important:: If the repository contains a RMSKIN.bmp image to used as a header image in the rmskin package, then it must be using 24-bit colors. Additionally, if the image is not exactly 400x60, then this action's python script will resize it accordingly.
This action's *rmskin-builder.py* is now also available as a Python executable script via PyPI.
However, it is important that your Python installation's *Scripts* folder is found in your
Operating System's environment variable ``PATH``. If you're using a Python virtual environment,
then the *Scripts* folder does not need to be in your Operating System's environment variable
``PATH``.

.. code-block:: shell
pip install rmskin-builder
rmskin-builder.exe --help
Input Arguments
===============

.. csv-table::
:header: "Argument", "Description", "Required"
:widths: 5, 15, 3
.. csv-table::
:header: "Argument", "Description", "Required"
:widths: 5, 15, 3

"version", "Version of the Rainmeter rmskin package. Defaults to last 8 digits of SHA from commit or ref/tags or otherwise 'x0x.x0xy'.", "no"
"title", "Name of the Rainmeter rmskin package. Defaults to name of repository or otherwise the last directory in the ``path`` argument.", "no"
"author", "Account Username maintaining the rmskin package. Defaults to Username that triggered the action or otherwise 'Unknown'.", "no"
"path", "Base directory of repo being packaged. Defaults to current working path", "no"
"dir_out", "Path to save generated rmskin package. Defaults to current working path", "no"
.. note::
You can use your repository's ``RMSKIN.ini`` file to override any above inputs except ``dir_out`` & ``path`` inputs.

The above arguments are used as CLI arguments to the *rmskin_builder.py* script, but remember to
append the CLI arguments' name with a ``--``. For example, setting the ``path`` argument to use a
relative directory called *tests*:

"version", "Version of the Rainmeter rmskin package. Defaults to last 8 digits of SHA from commit or ref/tags", "no"
"title", "Name of the Rainmeter rmskin package. Defaults to name of repository", "no"
"author", "Account Username maintaining the rmskin package. Defaults to Username that owns the repository.", "no"
"path", "Base directory of repo being packaged. Defaults to workflow's workspace path", "no"
"dir_out", "Path to save generated rmskin package. Defaults to workflow's workspace path", "no"
.. code-block:: shell
.. note::
You can use your repository's ``RMSKIN.ini`` file to override any above inputs except ``dir_out`` & ``path`` inputs.
rmskin-builder.exe --path tests
Output Arguments
================

* ``arc_name`` : The name of the generated rmskin file saved in the
path specified by ``dir_out`` input argument.
* ``arc_name`` : The name of the generated rmskin file saved in the
path specified by ``dir_out`` input argument.

If executing the *rmskin_builder.py* script when not in a Github Action Runner, then this output
argument will show in the script's log output (& not saved anywhere).

Ideal Repo Structure
====================

- root directory

- ``Skins`` a folder to contain all necessary Rainmeter skins
- ``RMSKIN.ini`` list of options specific to installing the skin(s)
- ``Layouts`` a folder that contains Rainmeter layout files
- ``Plugins`` a folder that contains Rainmeter plugins
- ``@Vault`` resources folder accessible by all installed skins

.. tip::
`A cookiecutter repository <https://github.com/2bndy5/Rainmeter-Cookiecutter>`_
has also been created to facilitate development of Rainmeter skins on Github
quickly.

Example Usage
=============

.. code-block:: yaml
name: RMSKIN Packager
on:
push:
pull_request:
release:
types:
- published
on:
push:
pull_request:
release:
types: [published]
jobs:
Build_n_Release:
runs-on: ubuntu-latest
Build_n_Release:
runs-on: ubuntu-latest
steps:
# Checkout code
- name: Checkout this Repo
uses: actions/checkout@v2
# Runs a rmskin packager action
- name: Run Build action
id: builder
uses: 2bndy5/rmskin-action@v1.1.2
# Use the output from the `builder` step
- name: Print the output filename
run: echo "The output file was ${{ steps.builder.outputs.arc_name }}"
# get release upload_url
- name: Get Release
id: get_release
uses: bruceadams/get-release@v1.2.0
if: github.event_name == 'release'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Upload the asset
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
if: github.event_name == 'release'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./${{ steps.builder.outputs.arc_name }}
asset_name: ${{ steps.builder.outputs.arc_name }}
asset_content_type: application/zip
# Checkout code
- name: Checkout this Repo
uses: actions/checkout@v3
# Runs a rmskin packager action
- name: Run Build action
id: builder
uses: 2bndy5/rmskin-action@v1.1.8
# Upload the asset (using the output from the `builder` step)
- name: Upload Release Asset
if: github.event_name == 'release'
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ steps.builder.outputs.arc_name }}
asset_content_type: application/zip
Loading