mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-02 18:10:18 +05:30
ci(release): publish latest.yml on all platforms, mirror to ConcreteInfo
This commit is contained in:
@@ -29,7 +29,7 @@ jobs:
|
|||||||
run: npm test
|
run: npm test
|
||||||
|
|
||||||
- name: Build Linux packages
|
- name: Build Linux packages
|
||||||
run: npm run build:linux-ci -- --publish=never
|
run: npm run build:linux-ci -- --publish=always
|
||||||
|
|
||||||
- name: Upload Linux artifacts
|
- name: Upload Linux artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
@@ -77,13 +77,13 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
CSC_LINK: code-signing-cert.pfx
|
CSC_LINK: code-signing-cert.pfx
|
||||||
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
|
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
|
||||||
run: npm run build:win-signed -- --publish=never
|
run: npm run build:win-signed -- --publish=always
|
||||||
|
|
||||||
- name: Build Windows packages (unsigned)
|
- name: Build Windows packages (unsigned)
|
||||||
if: ${{ env.CERT_AVAILABLE != 'true' }}
|
if: ${{ env.CERT_AVAILABLE != 'true' }}
|
||||||
env:
|
env:
|
||||||
CSC_IDENTITY_AUTO_DISCOVERY: 'false'
|
CSC_IDENTITY_AUTO_DISCOVERY: 'false'
|
||||||
run: npm run build:win-unsigned -- --publish=never
|
run: npm run build:win-unsigned -- --publish=always
|
||||||
|
|
||||||
- name: Upload Windows artifacts
|
- name: Upload Windows artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
@@ -117,7 +117,7 @@ jobs:
|
|||||||
- name: Build macOS packages (unsigned)
|
- name: Build macOS packages (unsigned)
|
||||||
env:
|
env:
|
||||||
CSC_IDENTITY_AUTO_DISCOVERY: 'false'
|
CSC_IDENTITY_AUTO_DISCOVERY: 'false'
|
||||||
run: npm run build:mac -- --publish=never
|
run: npm run build:mac -- --publish=always
|
||||||
|
|
||||||
- name: Upload macOS artifacts
|
- name: Upload macOS artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
@@ -161,3 +161,16 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
generate_release_notes: true
|
generate_release_notes: true
|
||||||
files: dist/*
|
files: dist/*
|
||||||
|
|
||||||
|
- name: Mirror artifacts to ConcreteInfo update feed
|
||||||
|
if: env.CONCRETEINFO_DEPLOY_HOOK != ''
|
||||||
|
env:
|
||||||
|
CONCRETEINFO_DEPLOY_HOOK: ${{ secrets.CONCRETEINFO_DEPLOY_HOOK }}
|
||||||
|
run: |
|
||||||
|
curl -fsSL -X POST \
|
||||||
|
-H "Authorization: Bearer ${{ secrets.CONCRETEINFO_DEPLOY_HOOK }}" \
|
||||||
|
-F "version=${GITHUB_REF_NAME#v}" \
|
||||||
|
-F "artifacts=@dist/latest-mac.yml" \
|
||||||
|
-F "artifacts=@dist/latest-linux.yml" \
|
||||||
|
-F "artifacts=@dist/latest-windows.yml" \
|
||||||
|
https://updates.concreteinfo.co.in/api/v1/ingest
|
||||||
|
|||||||
+2
-1
@@ -33,7 +33,8 @@
|
|||||||
"dist:all": "electron-builder -mwl",
|
"dist:all": "electron-builder -mwl",
|
||||||
"download-tools": "node scripts/download-tools.js",
|
"download-tools": "node scripts/download-tools.js",
|
||||||
"generate-icons": "node scripts/generate-icons.js",
|
"generate-icons": "node scripts/generate-icons.js",
|
||||||
"build:icon-icns": "node scripts/build-icon-icns.js"
|
"build:icon-icns": "node scripts/build-icon-icns.js",
|
||||||
|
"publish:concreteinfo": "node scripts/publish-concreteinfo.js"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"markdown",
|
"markdown",
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
const version = process.argv[2] || require('../package.json').version;
|
||||||
|
const hook = process.env.CONCRETEINFO_DEPLOY_HOOK;
|
||||||
|
if (!hook) {
|
||||||
|
console.error('CONCRETEINFO_DEPLOY_HOOK not set');
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
const candidates = [
|
||||||
|
'latest-mac.yml',
|
||||||
|
'latest-linux.yml',
|
||||||
|
'latest-windows.yml',
|
||||||
|
`MarkdownConverter-${version}.dmg`,
|
||||||
|
`markdown-converter_${version}_amd64.deb`,
|
||||||
|
`MarkdownConverter-Setup-${version}.exe`,
|
||||||
|
];
|
||||||
|
|
||||||
|
const dist = path.resolve(__dirname, '..', 'dist');
|
||||||
|
for (const f of candidates) {
|
||||||
|
if (!fs.existsSync(path.join(dist, f))) {
|
||||||
|
console.error(`missing ${f} — run electron-builder first`);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const form = new FormData();
|
||||||
|
form.append('version', version);
|
||||||
|
for (const f of candidates) {
|
||||||
|
if (fs.existsSync(path.join(dist, f))) {
|
||||||
|
form.append('artifacts', fs.createReadStream(path.join(dist, f)), f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fetch('https://updates.concreteinfo.co.in/api/v1/ingest', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: { Authorization: `Bearer ${hook}` },
|
||||||
|
body: form,
|
||||||
|
})
|
||||||
|
.then((r) => {
|
||||||
|
console.log('ingest status', r.status);
|
||||||
|
process.exit(r.ok ? 0 : 1);
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
console.error('ingest failed:', e);
|
||||||
|
process.exit(1);
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user