Skip to content

Commit 8de5904

Browse files
authored
Merge pull request #102 from EXILL-SUARL/exilvm/issue84
Update README
2 parents a0bea4b + c0ea295 commit 8de5904

File tree

2 files changed

+77
-46
lines changed

2 files changed

+77
-46
lines changed
File renamed without changes.

README.md

+77-46
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Themforest-automation
22

3-
[![Docker build](https://github.com/EXILL-SUARL/themeforest-automation/actions/workflows/docker-build.yml/badge.svg)](https://github.com/EXILL-SUARL/themeforest-automation/actions) [![Docker publish](https://github.com/EXILL-SUARL/themeforest-automation/actions/workflows/docker-publish.yml/badge.svg)](https://github.com/EXILL-SUARL/themeforest-automation/actions) ![GitHub commits since latest release (by date including pre-releases)](https://img.shields.io/github/commits-since/EXILL-SUARL/themeforest-automation/latest?include_prereleases) [![GitHub license](https://img.shields.io/github/license/EXILL-SUARL/themeforest-automation)](https://github.com/EXILL-SUARL/themeforest-automation/blob/master/LICENSE)
3+
[![Docker test](https://github.com/EXILL-SUARL/themeforest-automation/actions/workflows/docker-test.yml/badge.svg)](https://github.com/EXILL-SUARL/themeforest-automation/actions) [![Docker publish](https://github.com/EXILL-SUARL/themeforest-automation/actions/workflows/docker-publish.yml/badge.svg)](https://github.com/EXILL-SUARL/themeforest-automation/actions) ![GitHub commits since latest release (by date including pre-releases)](https://img.shields.io/github/commits-since/EXILL-SUARL/themeforest-automation/latest?include_prereleases) [![GitHub license](https://img.shields.io/github/license/EXILL-SUARL/themeforest-automation)](https://github.com/EXILL-SUARL/themeforest-automation/blob/master/LICENSE)
44

55
This is a Docker container that automates boring and repetitive tasks that are part of [Envato's Themes Item Preparation & Technical Requirements](https://help.author.envato.com/hc/en-us/articles/360000470826-Themes-Item-Preparation-Technical-Requirements).
66

@@ -10,77 +10,108 @@ It is mainly utilized by [GitHub Actions](https://docs.github.com/en/actions) de
1010

1111
The image can be found at GitHub's Container Registry: https://github.com/orgs/EXILL-SUARL/packages/container/package/themeforest-automation.
1212

13+
## Usage
14+
15+
Run a workflow:
16+
17+
```
18+
$ runner <workflow_name> [arguments]
19+
```
20+
21+
Run tests:
22+
23+
```
24+
$ runner test
25+
```
26+
1327
## Usage with Github Actions
1428

1529
```yaml
1630
name: Pre-release tasks
1731
on:
18-
push:
19-
tags:
20-
- 'v*'
32+
workflow_dispatch:
33+
inputs:
34+
PRERELEASE:
35+
required: false
36+
type: string
37+
TAG:
38+
required: true
39+
type: string
2140
jobs:
22-
export-vars:
41+
prepare:
2342
runs-on: ubuntu-latest
2443
outputs:
44+
PRERELEASE: ${{ steps.vars.outputs.PRERELEASE }}
45+
FULLVERSION: ${{ steps.vars.outputs.FULLVERSION }}
2546
RELEASE_NAME: ${{ steps.vars.outputs.RELEASE_NAME }}
26-
TMP_DIR: ${{ steps.vars.outputs.TMP_DIR }}
47+
TMPDIR: ${{ steps.vars.outputs.TMPDIR }}
2748
STRIPPED_ZIP_DIR: ${{ steps.vars.outputs.STRIPPED_ZIP_DIR }}
2849
STRIPPED_ZIP_NAME: ${{ steps.vars.outputs.STRIPPED_ZIP_NAME }}
2950
STRIPPED_ZIP: ${{ steps.vars.outputs.STRIPPED_ZIP }}
3051
steps:
31-
- name: Export variables
52+
- name: Export vars # Export action environment variables
53+
id: vars
3254
run: |
33-
RELEASE_NAME=${{ github.event.repository.name }}-${{ github.ref_name }}
34-
TMP_DIR=/tmp/$RELEASE_NAME-tmp
35-
STRIPPED_ZIP_DIR=$TMP_DIR/to-deliver
55+
echo "PRERELEASE=${{ inputs.PRERELEASE }}" >> $GITHUB_OUTPUT
56+
echo "FULLVERSION=${{ inputs.TAG }}" >> $GITHUB_OUTPUT
57+
RELEASE_NAME=${{ github.event.repository.name }}-${{ inputs.TAG }}
58+
TMPDIR=/tmp/$RELEASE_NAME-tmp
59+
STRIPPED_ZIP_DIR=$TMPDIR/to-deliver
3660
STRIPPED_ZIP_NAME=$RELEASE_NAME.zip
37-
echo "::set-output name=RELEASE_NAME::${{ github.event.repository.name }}-${{ github.ref_name }}"
38-
echo "::set-output name=TMP_DIR::$TMP_DIR"
39-
echo "::set-output name=STRIPPED_ZIP_DIR::$STRIPPED_ZIP_DIR"
40-
echo "::set-output name=STRIPPED_ZIP_NAME::$STRIPPED_ZIP_NAME"
41-
echo "::set-output name=STRIPPED_ZIP::$STRIPPED_ZIP_DIR/$STRIPPED_ZIP_NAME"
61+
echo "RELEASE_NAME=${{ github.event.repository.name }}-${{ inputs.TAG }}" >> $GITHUB_OUTPUT
62+
echo "TMPDIR=$TMPDIR" >> $GITHUB_OUTPUT
63+
echo "STRIPPED_ZIP_DIR=$STRIPPED_ZIP_DIR" >> $GITHUB_OUTPUT
64+
echo "STRIPPED_ZIP_NAME=$STRIPPED_ZIP_NAME" >> $GITHUB_OUTPUT
65+
echo "STRIPPED_ZIP=$STRIPPED_ZIP_DIR/$STRIPPED_ZIP_NAME" >> $GITHUB_OUTPUT
66+
- uses: actions/[email protected] # Upload the clean repository checkout for later use
67+
with:
68+
ref: ${{ inputs.TAG }}
69+
- name: upload repository artifact
70+
uses: actions/upload-artifact@v3
71+
with:
72+
name: repository
73+
path: ./
4274
process:
4375
runs-on: ubuntu-latest
44-
needs: [export-vars] # define prerequisite jobs
76+
needs: [prepare] # Define prerequisite jobs
4577
outputs:
46-
# output-example: # define an output
78+
METADATA: ${{ steps.metadata.outputs.METADATA }} # Define an output
4779
container:
48-
image: ghcr.io/exill-suarl/themeforest-automation:latest # it's recommended to use SemVer tags to avoid breaking changes
80+
image: ghcr.io/exill-suarl/themeforest-automation:latest # It's recommended to use SemVer tags to avoid breaking changes
4981
env:
50-
TMP_DIR: ${{ needs.export-vars.outputs.TMP_DIR }}
82+
TMPDIR: ${{ needs.prepare.outputs.TMPDIR }}
83+
defaults:
84+
run:
85+
shell: bash -e {0} # Use Bash as the default Shell for this job
5186
steps:
52-
- name: execute post-run # to update OS packages and install dependencies.
53-
run: post-run.sh
54-
- name: Clone project # clone a repository to process
55-
uses: actions/checkout@v3
56-
- name: Strip files
57-
run: globfile-del.sh ./.itemignore # delete every file/directory that match the defined glob paths in .itemignore
58-
- name: Generate documentation # generate documentation from a markdown file
59-
run: md-to-doc.sh ./documentation.md documentation
60-
- name: Blur ./public # batch-blur images in ./public directory
61-
run: batch-blur.sh ./public
62-
- name: ZIP CWD # export the current working directory as a ZIP
63-
run: dir-zip.sh . ${{ needs.export-vars.outputs.STRIPPED_ZIP_DIR }} ${{ needs.export-vars.outputs.STRIPPED_ZIP_NAME }}
64-
- name: upload stripped ZIP as an artifact
65-
uses: actions/upload-artifact@v3 # upload Artifact
87+
- uses: actions/download-artifact@v3 # Use the previously uploaded repository artifact
88+
with:
89+
name: repository
90+
- name: Import metadata # Parse JSONs for metadata purposes
91+
id: metadata
92+
run: |
93+
METADATA=$(metadata-parser.sh ./package.json ./.devcontainer/config/metadata.json)
94+
echo "METADATA=$METADATA" >> $GITHUB_OUTPUT
95+
- name: Generate documentation # Generate documentation from a markdown file
96+
run: runner md-to-doc.sh '${{ steps.metadata.outputs.METADATA }}' ./documentation.md documentation
97+
- name: Generate dependencies report # Generate dependencies report
98+
run: runner report-deps.sh .devcontainer/config/dependency_decisions.yml ./documentation
99+
- name: Blur /public # Blur all images in the public folder
100+
run: runner batch-blur.sh ./public
101+
- name: Ignore files # Delete every file/directory that matches the defined glob paths in .itemignore
102+
run: runner globfile-del.sh ./.itemignore
103+
- name: ZIP the CWD # Export the current working directory as a ZIP
104+
run: runner dir-zip.sh . ${{ needs.prepare.outputs.STRIPPED_ZIP_DIR }} ${{ needs.prepare.outputs.STRIPPED_ZIP_NAME }}
105+
- name: upload stripped item artifact # Upload for later delivery (as a ZIP file)
106+
uses: actions/upload-artifact@v3
66107
with:
67108
name: stripped-zip
68-
path: ${{ needs.export-vars.outputs.STRIPPED_ZIP }}
69-
- name: upload CWD as an artifact
70-
uses: actions/upload-artifact@v3 # upload Artifact
109+
path: ${{ needs.prepare.outputs.STRIPPED_ZIP }}
110+
- name: upload stripped directory artifact # Upload for later delivery (as a directory)
111+
uses: actions/upload-artifact@v3
71112
with:
72113
name: stripped-directory
73114
path: ./
74-
- name: Send to FTP # upload processed files to an FTP server
75-
uses: SamKirkland/[email protected]
76-
with:
77-
local-dir: './'
78-
dangerous-clean-slate: false
79-
server: ${{ secrets.ftp_delivery_server }}
80-
username: ${{ secrets.ftp_delivery_username }}
81-
password: ${{ secrets.ftp_delivery_password }}
82-
- name: Download Artifact # download all previously uploaded Artifacts
83-
uses: actions/download-artifact@v3
84115
```
85116
86117
#### More information on Github Action usage can be found at:

0 commit comments

Comments
 (0)