Skip to content

Commit d49ae34

Browse files
fix npm package (#639)
1 parent 215c32f commit d49ae34

File tree

21 files changed

+173
-56
lines changed

21 files changed

+173
-56
lines changed

.github/workflows/create-release.yml

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -63,22 +63,17 @@ jobs:
6363

6464
- name: Build Release Executables (Windows)
6565
run: |
66-
pyinstaller --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata --onefile icloudpd.py icloud.py --name icloudpd-${{needs.get_version.outputs.icloudpd_version}}-windows-amd64
67-
pyinstaller --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata --onefile icloud.py --name icloud-${{needs.get_version.outputs.icloudpd_version}}-windows-amd64
68-
pyinstaller --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata --onefile exec.py --name icloudpd-ex-${{needs.get_version.outputs.icloudpd_version}}-windows-amd64
66+
scripts/build_bin_windows ${{needs.get_version.outputs.icloudpd_version}} amd64
6967
if: ${{ matrix.os == 'windows-latest' }}
7068

7169
- name: Build Release Executables (Linux)
7270
run: |
73-
pyinstaller --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata --onefile icloudpd.py icloud.py --name icloudpd-${{needs.get_version.outputs.icloudpd_version}}-linux-amd64
74-
pyinstaller --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata --onefile icloud.py --name icloud-${{needs.get_version.outputs.icloudpd_version}}-linux-amd64
75-
pyinstaller --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata --onefile exec.py --name icloudpd-ex-${{needs.get_version.outputs.icloudpd_version}}-linux-amd64
71+
scripts/build_bin_linux ${{needs.get_version.outputs.icloudpd_version}} amd64
7672
if: ${{ matrix.os == 'ubuntu-latest' }}
7773

7874
- name: Build Release Executables (MacOS)
7975
run: |
80-
pyinstaller --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata --onefile icloudpd.py icloud.py --name icloudpd-${{needs.get_version.outputs.icloudpd_version}}-macos-amd64
81-
pyinstaller --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata --onefile exec.py --name icloudpd-ex-${{needs.get_version.outputs.icloudpd_version}}-macos-amd64
76+
scripts/build_bin_macos ${{needs.get_version.outputs.icloudpd_version}} amd64
8277
if: ${{ matrix.os == 'macos-latest' }}
8378

8479
- name: Upload artifacts
@@ -184,25 +179,16 @@ jobs:
184179
path: |
185180
dist
186181
187-
- name: Make Package
182+
- name: Build Package
188183
run: |
189-
cp -r npm dist/npm
190-
cp LICENSE.md dist/npm/icloudpd
191-
mkdir dist/npm/@icloudpd/win32-x64/bin
192-
mv dist/icloudpd-${{needs.get_version.outputs.icloudpd_version}}-windows-amd64.exe dist/npm/@icloudpd/win32-x64/bin/icloudpd.exe
193-
cp LICENSE.md dist/npm/@icloudpd/win32-x64/
194-
mkdir dist/npm/@icloudpd/linux-x64/bin
195-
mv dist/icloudpd-${{needs.get_version.outputs.icloudpd_version}}-linux-amd64 dist/npm/@icloudpd/linux-x64/bin/icloudpd
196-
cp LICENSE.md dist/npm/@icloudpd/linux-x64/
197-
mkdir dist/npm/@icloudpd/darwin-x64/bin
198-
mv dist/icloudpd-${{needs.get_version.outputs.icloudpd_version}}-macos-amd64 dist/npm/@icloudpd/darwin-x64/bin/icloudpd
199-
cp LICENSE.md dist/npm/@icloudpd/darwin-x64/
184+
scripts/build_npm ${{needs.get_version.outputs.icloudpd_version}}
200185
201186
- name: Publish NPM
202187
run: |
203188
npm publish dist/npm/@icloudpd/linux-x64 --access public
204189
npm publish dist/npm/@icloudpd/win32-x64 --access public
205190
npm publish dist/npm/@icloudpd/darwin-x64 --access public
191+
npm publish dist/npm/@icloudpd/darwin-arm64 --access public
206192
npm publish dist/npm/icloudpd --access public
207193
env:
208194
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/quality-checks.yml

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -89,22 +89,17 @@ jobs:
8989

9090
- name: Build Release Executables (Windows)
9191
run: |
92-
pyinstaller --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata --onefile icloudpd.py icloud.py --name icloudpd-${{needs.get_version.outputs.icloudpd_version}}-windows-amd64
93-
pyinstaller --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata --onefile icloud.py --name icloud-${{needs.get_version.outputs.icloudpd_version}}-windows-amd64
94-
pyinstaller --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata --onefile exec.py --name icloudpd-ex-${{needs.get_version.outputs.icloudpd_version}}-windows-amd64
92+
scripts/build_bin_windows ${{needs.get_version.outputs.icloudpd_version}} amd64
9593
if: ${{ matrix.os == 'windows-latest' }}
9694

9795
- name: Build Release Executables (Linux)
9896
run: |
99-
pyinstaller --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata --onefile icloudpd.py icloud.py --name icloudpd-${{needs.get_version.outputs.icloudpd_version}}-linux-amd64
100-
pyinstaller --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata --onefile icloud.py --name icloud-${{needs.get_version.outputs.icloudpd_version}}-linux-amd64
101-
pyinstaller --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata --onefile exec.py --name icloudpd-ex-${{needs.get_version.outputs.icloudpd_version}}-linux-amd64
97+
scripts/build_bin_linux ${{needs.get_version.outputs.icloudpd_version}} amd64
10298
if: ${{ matrix.os == 'ubuntu-latest' }}
10399

104100
- name: Build Release Executables (MacOS)
105101
run: |
106-
pyinstaller --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata --onefile icloudpd.py icloud.py --name icloudpd-${{needs.get_version.outputs.icloudpd_version}}-macos-amd64
107-
pyinstaller --collect-all keyrings.alt --hidden-import pkgutil --collect-all tzdata --onefile exec.py --name icloudpd-ex-${{needs.get_version.outputs.icloudpd_version}}-macos-amd64
102+
scripts/build_bin_macos ${{needs.get_version.outputs.icloudpd_version}} amd64
108103
if: ${{ matrix.os == 'macos-latest' }}
109104

110105
- name: Upload artifacts
@@ -165,25 +160,16 @@ jobs:
165160
path: |
166161
dist
167162
168-
- name: Make Package
163+
- name: Build Package
169164
run: |
170-
cp -r npm dist/npm
171-
cp LICENSE.md dist/npm/icloudpd
172-
mkdir dist/npm/@icloudpd/win32-x64/bin
173-
mv dist/icloudpd-${{needs.get_version.outputs.icloudpd_version}}-windows-amd64.exe dist/npm/@icloudpd/win32-x64/bin/icloudpd.exe
174-
cp LICENSE.md dist/npm/@icloudpd/win32-x64/
175-
mkdir dist/npm/@icloudpd/linux-x64/bin
176-
mv dist/icloudpd-${{needs.get_version.outputs.icloudpd_version}}-linux-amd64 dist/npm/@icloudpd/linux-x64/bin/icloudpd
177-
cp LICENSE.md dist/npm/@icloudpd/linux-x64/
178-
mkdir dist/npm/@icloudpd/darwin-x64/bin
179-
mv dist/icloudpd-${{needs.get_version.outputs.icloudpd_version}}-macos-amd64 dist/npm/@icloudpd/darwin-x64/bin/icloudpd
180-
cp LICENSE.md dist/npm/@icloudpd/darwin-x64/
165+
scripts/build_npm ${{needs.get_version.outputs.icloudpd_version}}
181166
182167
- name: Publish NPM (Dry-run)
183168
run: |
184169
npm publish dist/npm/@icloudpd/linux-x64 --access public --dry-run=true
185170
npm publish dist/npm/@icloudpd/win32-x64 --access public --dry-run=true
186171
npm publish dist/npm/@icloudpd/darwin-x64 --access public --dry-run=true
172+
npm publish dist/npm/@icloudpd/darwin-arm64 --access public --dry-run=true
187173
npm publish dist/npm/icloudpd --access public --dry-run=true
188174
env:
189175
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
## Unreleased
44

5-
## 1.13.3 (2023-06-11)
5+
## 1.13.4 (2023-06-14)
6+
7+
- experimental: fix npm packaging
8+
9+
## 1.13.4 (2023-06-11)
610

711
- experimental: fix npm registry publishing
812

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ When testing a bugfix it is important to test the faulty behavior and also the e
133133
## How to release
134134

135135
We have github actions taking care for building, testing, and releasing software. Building and testing are happenning automatically on git pushed, pull requests, and merges. For releases the following steps are manual:
136-
- Bump version in setup.py, all .md files, and all package.json files in npm subfolder
136+
- Bump version in setup.py, abd all .md files
137137
- Update CHANGELOG.md with date of the release
138138
- Update CHANGELOG.md with release changes if they were not added with commits
139139
- Commit & push/merge changes

README_NPM.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ A command-line tool to download all your iCloud photos.
55
## [EXPERIMENTAL] Install, Run, and Use
66

77
``` sh
8-
npx icloudpd --directory /data --username [email protected] --watch-with-interval 3600
8+
npx --yes icloudpd --directory /data --username [email protected] --watch-with-interval 3600
99
```
1010

1111
Synchronization logic can be adjusted with command-line parameters. Run the following to get full list:
1212

1313
``` sh
14-
npx icloudpd --help
14+
npx --yes icloudpd --help
1515
```
1616

1717
## Getting Node and Npm

jq/version.jq

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.version |= $version | (.optionalDependencies |= with_entries(.value |= $version))? // .
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# icloudpd
2+
3+
The macOS ARM 64-bit binary for icloudpd, a iCloud Photo Downloader. See https://github.com/icloud_photo_downloader/icloud_photo_downloader for details.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "@icloudpd/darwin-arm64",
3+
"version": "0.0.1",
4+
"description": "The macOS ARM 64-bit binary for icloudpd, a iCloud Photo Downloader.",
5+
"repository": "https://github.com/icloud_photo_downloader/icloud_photo_downloader",
6+
"license": "MIT",
7+
"engines": {
8+
"node": ">=12"
9+
},
10+
"preferUnplugged": true,
11+
"os": [
12+
"darwin"
13+
],
14+
"cpu": [
15+
"arm64"
16+
]
17+
}

npm/@icloudpd/darwin-x64/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@icloudpd/darwin-x64",
3-
"version": "1.13.3",
3+
"version": "0.0.1",
44
"description": "The macOS 64-bit binary for icloudpd, a iCloud Photo Downloader.",
55
"repository": "https://github.com/icloud_photo_downloader/icloud_photo_downloader",
66
"license": "MIT",

npm/@icloudpd/linux-x64/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@icloudpd/linux-x64",
3-
"version": "1.13.3",
3+
"version": "0.0.1",
44
"description": "The Linux 64-bit binary for icloudpd, a iCloud Photo Downloader.",
55
"repository": "https://github.com/icloud_photo_downloader/icloud_photo_downloader",
66
"license": "MIT",

0 commit comments

Comments
 (0)