refactor: optimized workflow
This commit is contained in:
49
.github/workflows/main.yml
vendored
49
.github/workflows/main.yml
vendored
@@ -6,35 +6,43 @@ on:
|
||||
- "_sprites/**"
|
||||
- "scripts/**"
|
||||
|
||||
concurrency:
|
||||
group: sorting-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
actions: write
|
||||
|
||||
jobs:
|
||||
run-scripts:
|
||||
if: github.actor != 'github-actions[bot]'
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: setup
|
||||
uses: actions/setup-node@v4
|
||||
- name: setup node + npm cache
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version: "20"
|
||||
cache: "npm"
|
||||
cache-dependency-path: ./package-lock.json
|
||||
|
||||
- name: requirments
|
||||
run: npm ci
|
||||
- name: npm ci
|
||||
working-directory: ./scripts
|
||||
run: npm ci --no-audit --no-fund
|
||||
|
||||
- name: setup python
|
||||
uses: actions/setup-python@v5
|
||||
- name: setup python + pip cache
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: "3.13"
|
||||
cache: "pip"
|
||||
cache-dependency-path: ./requirements.txt
|
||||
|
||||
- name: install python deps
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install pillow
|
||||
working-directory: ./scripts
|
||||
run: pip install -r requirements.txt
|
||||
|
||||
- name: scripts
|
||||
working-directory: ./scripts
|
||||
@@ -54,31 +62,13 @@ jobs:
|
||||
git commit -m "actions commit" || exit 0
|
||||
git push
|
||||
|
||||
- name: delete previous actions
|
||||
uses: actions/github-script@v6
|
||||
id: artifact
|
||||
with:
|
||||
script: |
|
||||
const res = await github.rest.actions.listArtifactsForRepo({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
})
|
||||
|
||||
res.data.artifacts
|
||||
.forEach(({ id }) => {
|
||||
github.rest.actions.deleteArtifact({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
artifact_id: id,
|
||||
})
|
||||
})
|
||||
|
||||
- name: upload sorted
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: sorted
|
||||
path: ./_sprites/sorted
|
||||
retention-days: 15
|
||||
compression-level: 0
|
||||
|
||||
- name: upload sorted-merged
|
||||
uses: actions/upload-artifact@v4
|
||||
@@ -86,6 +76,7 @@ jobs:
|
||||
name: sorted-merged
|
||||
path: ./_sprites/sorted-merged
|
||||
retention-days: 15
|
||||
compression-level: 0
|
||||
|
||||
- name: remove temp sorted folder
|
||||
run: |
|
||||
|
||||
23
package-lock.json
generated
23
package-lock.json
generated
@@ -4,23 +4,10 @@
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"dependencies": {
|
||||
"adm-zip": "^0.5.16"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/adm-zip": "^0.5.7",
|
||||
"@types/node": "^24.0.15"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/adm-zip": {
|
||||
"version": "0.5.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/adm-zip/-/adm-zip-0.5.7.tgz",
|
||||
"integrity": "sha512-DNEs/QvmyRLurdQPChqq0Md4zGvPwHerAJYWk9l2jCbD1VPpnzRJorOdiq4zsw09NFbYnhfsoEhWtxIzXpn2yw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "24.0.15",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.0.15.tgz",
|
||||
@@ -30,14 +17,6 @@
|
||||
"undici-types": "~7.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/adm-zip": {
|
||||
"version": "0.5.16",
|
||||
"resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.16.tgz",
|
||||
"integrity": "sha512-TGw5yVi4saajsSEgz25grObGHEUaDrniwvA2qwSC060KfqGPdglhvPMA2lPIoxs3PQIItj2iag35fONcQqgUaQ==",
|
||||
"engines": {
|
||||
"node": ">=12.0"
|
||||
}
|
||||
},
|
||||
"node_modules/undici-types": {
|
||||
"version": "7.8.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.8.0.tgz",
|
||||
@@ -45,4 +24,4 @@
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,5 @@
|
||||
{
|
||||
"devDependencies": {
|
||||
"@types/adm-zip": "^0.5.7",
|
||||
"@types/node": "^24.0.15"
|
||||
},
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"adm-zip": "^0.5.16"
|
||||
}
|
||||
}
|
||||
1
requirements.txt
Normal file
1
requirements.txt
Normal file
@@ -0,0 +1 @@
|
||||
pillow==11.1.0
|
||||
Reference in New Issue
Block a user