Skip to content

Commit

Permalink
Removes GitHub raw files deployment strategy
Browse files Browse the repository at this point in the history
Should be completely superseded by deployment through the website
  • Loading branch information
Joppe committed Aug 14, 2024
1 parent cfa6236 commit f2075e9
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 39,359 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,11 @@ jobs:
uses: Endbug/version-check@v2
with:
diff-search: true
- name: Commit user style changes
- name: Set version tag on last commit
if: steps.version-check.outputs.changed == 'true'
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
git add public/*.user.css
git commit -m "Publish updates v${{ steps.version-check.outputs.version }}"
git tag v${{ steps.version-check.outputs.version }}
- name: Publish user style changes
- name: Push version tag
if: steps.version-check.outputs.changed == 'true'
uses: ad-m/[email protected]
with:
Expand Down
33 changes: 21 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,21 @@ There is no intent to achieve completeness, let alone prettyness, the goal is to
## Developing

### Running locally
1. Use any static fileserver, e.g. the [Live Server extension](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer) for VS Code, to serve the css files in the `styles` folder.
1. Use any static fileserver, e.g. the [Live Server extension](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer) for VS Code, to serve the css files in the `src/styles` folder.
1. Click the stylus extension button, and choose **Manage**.
1. Under "Actions" click **Write new style**. Make sure the **as Usercss** checkbox is unchecked.
1. Give the new style a name, e.g. Local test recoloring.
1. Replace the `@-moz-document domain("example.com") { /* Insert code here... */ }` section with the code below.
1. Adjust the import url's if necessary.
1. Paste the code below into the empty "Code 1" section.
1. This will spawn a popup with the pasted code, confirm by clicking **Overwrite style**.
1. Adjust the host of the `@import` url's if necessary.
1. Give the style a nice name in the text box under **Add Style** in the sidebar.
1. Click **Save**.
1. Enable the new style when in your TOPdesk environment (and make sure other styles are off).
1. Make sure to enable the **Support custom colors** user setting in TOPdesk for your test user.
1. You can test the schemes by adding a `cobalt`, `green`, or `default` attribute to the `<html>` element.

The local recoloring will now apply to your TOPdesk environment. Add a `cobalt`, `green` attribute to the `<html>` element to test a theme other than "default dark".

Finally, two points of note:
1. Make sure any other recoloring themes are off to prevent interference. You can quickly enable/disable a style in the Stylus dropdown when a TOPdesk environment is loaded.
1. Make sure to enable the **Support custom colors** user setting in TOPdesk. Some styling requires the extra attributes in the HTML to be able to apply correctly.

```css
@-moz-document regexp("http(s)?://.*/tas/(secure|public)/login/form.*"), regexp("http(s)?://.*/tas/(secure|public)/login/saml"), regexp("http(s)?://.*/tas/(secure|public)/logout"), regexp("http(s)?://.*/tas/admin/.*") {
Expand Down Expand Up @@ -161,17 +166,21 @@ There is no intent to achieve completeness, let alone prettyness, the goal is to


### Releasing a user style update
The user style css files for each theme, and the legacy `topdesk-operator-recoloring.user.css`, is generated by a GitHub action whenever the version is increased in the `package.json`.
The user style css files for each theme are generated during the `build` step.
This step is automatically executed during deployment on GitHub after every push.

For any kind of update to the styles, update the version number in the `package.json` file.
This number is injected in the user style files, allowing Stylus to update the style either by user request or in the automated update cycle.

The version number of the package.json will be injected in the user style files, allowing Stylus to update the style either by user request or in the automated update cycle.
A new version number will also be picked up by the deployment script and that commit will be tagged with the version number in Git.

These files are also generated in the `public` folder locally on each `npm run build`. Please, **do not push the generated user styles**.
Updates to the site are *not* versioned.


### Homepage
The homepage is a static page hosted by github pages, all the source files for the homepage are located in the `site` folder.
The [homepage](https://topdesk.github.io/operator-recoloring/) is a static page hosted by github pages, all the source files for the homepage are located in the `site` folder.

The actual website is generated by a GitHub action, but you can also build it locally with `npm run build`. You can then find the files in the `docs` folder. Note: this will also generate the user style files in the `public` folder, please, **do not push the generated user styles**.
The actual website is generated by a GitHub action, but you can also build it locally with `npm run build`. You can then find the files in the `docs` folder.

Note that the homepage also comes with `worker.js`, which calculates a filter value for a given rgb value. This calculation is moved off the main thread as it can take a while for the calculation to arrive at a suitable answer.

Expand All @@ -184,7 +193,7 @@ If you do not want to wait for the automated check to run, you can force an upda
- Click on the Stylus extension icon in the browser bar, and click the **Manage** button in the popup.
- This will open a new tab with the overview of all the installed styles.
- Click the **Check all styles for updates** button under **Actions**.
- When it has found updates, an **Apply all updates** button will appear underneath, and the overview will change to show only the styles for which it has found
- When it has found updates, an **Apply all updates** button will appear underneath, and the overview will change to show only the styles for which it has found updates.
- If the update is __very__ recent, Stylus may not yet be able to find it.
- If Stylus can't find it after 5 minutes, it is likely that a syntax error is present in the user.css.
updates.
Expand Down
Loading

0 comments on commit f2075e9

Please sign in to comment.