mirror of
https://github.com/lights0123/n-link.git
synced 2025-01-08 17:25:27 +00:00
Upload AppImage
This commit is contained in:
parent
a1149a8afb
commit
ddbd69f85d
73
.github/workflows/release.yml
vendored
73
.github/workflows/release.yml
vendored
|
@ -5,11 +5,37 @@ on:
|
||||||
- release
|
- release
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
create-release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
RELEASE_UPLOAD_ID: ${{ steps.create_release.outputs.id }}
|
||||||
|
RELEASE_UPLOAD_URL: ${{ steps.create_release.outputs.upload_url }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: setup node
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: 12
|
||||||
|
- name: get version
|
||||||
|
run: echo ::set-env name=PACKAGE_VERSION::$(node -p "require('./package.json').version")
|
||||||
|
- name: create release
|
||||||
|
id: create_release
|
||||||
|
uses: actions/create-release@v1.1.0
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
tag_name: v${{ env.PACKAGE_VERSION }}
|
||||||
|
release_name: "N-Link v${{ env.PACKAGE_VERSION }}"
|
||||||
|
body: "See the assets to download this version and install."
|
||||||
|
draft: true
|
||||||
|
prerelease: false
|
||||||
publish-tauri:
|
publish-tauri:
|
||||||
|
needs: create-release
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
platform: [macos-latest, ubuntu-18.04, windows-latest]
|
platform: [ macos-latest, ubuntu-18.04, windows-latest ]
|
||||||
|
|
||||||
runs-on: ${{ matrix.platform }}
|
runs-on: ${{ matrix.platform }}
|
||||||
steps:
|
steps:
|
||||||
|
@ -58,12 +84,47 @@ jobs:
|
||||||
- name: install app dependencies
|
- name: install app dependencies
|
||||||
run: yarn
|
run: yarn
|
||||||
- uses: tauri-apps/tauri-action@v0
|
- uses: tauri-apps/tauri-action@v0
|
||||||
|
if: runner.os == 'Linux'
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
npmScript: "tauri:build"
|
npmScript: "tauri:build"
|
||||||
tagName: v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
|
- uses: tauri-apps/tauri-action@v0
|
||||||
releaseName: "N-Link v__VERSION__"
|
if: runner.os != 'Linux'
|
||||||
body: "See the assets to download this version and install."
|
env:
|
||||||
draft: true
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
prerelease: false
|
with:
|
||||||
|
npmScript: "tauri:build"
|
||||||
|
releaseId: ${{ needs.create-release.outputs.RELEASE_UPLOAD_ID }}
|
||||||
|
- name: Upload Release
|
||||||
|
if: runner.os == 'Linux'
|
||||||
|
uses: actions/github-script@v2
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
script: |
|
||||||
|
console.log('environment', process.versions);
|
||||||
|
|
||||||
|
const fs = require('fs').promises;
|
||||||
|
|
||||||
|
const {repo: {owner, repo}, sha} = context;
|
||||||
|
console.log({owner, repo, sha});
|
||||||
|
const {name, version} = require('./package.json');
|
||||||
|
const arch = process.arch === 'x64' ? 'amd64' : process.arch;
|
||||||
|
|
||||||
|
for (let file of (await fs.readdir('src-tauri/target/release/bundle/deb', {withFileTypes: true})).filter(dir => dir.isFile()).map(({name}) => name)) {
|
||||||
|
console.log('uploading', file);
|
||||||
|
|
||||||
|
await github.repos.uploadReleaseAsset({
|
||||||
|
owner, repo,
|
||||||
|
release_id: "${{ needs.create-release.outputs.RELEASE_UPLOAD_ID }}",
|
||||||
|
name: file,
|
||||||
|
data: await fs.readFile(`./${file}`)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
await github.repos.uploadReleaseAsset({
|
||||||
|
owner, repo,
|
||||||
|
release_id: "${{ needs.create-release.outputs.RELEASE_UPLOAD_ID }}",
|
||||||
|
name: `${name}_${version}_${arch}.AppImage`,
|
||||||
|
data: await fs.readFile(`src-tauri/target/release/bundle/appimage/n-link.AppImage`)
|
||||||
|
});
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
},
|
},
|
||||||
"bundle": {
|
"bundle": {
|
||||||
"active": true,
|
"active": true,
|
||||||
"targets": "all",
|
"targets": ["deb", "msi", "appimage", "dmg"],
|
||||||
"identifier": "com.lights0123.n-link",
|
"identifier": "com.lights0123.n-link",
|
||||||
"icon": [
|
"icon": [
|
||||||
"icons/32x32.png",
|
"icons/32x32.png",
|
||||||
|
|
Loading…
Reference in a new issue