Merge pull request #3052 from h3poteto/feat/auto-release

Upload release assets automatically from GitHub Actions
This commit is contained in:
AkiraFukushima 2022-01-04 11:08:31 +09:00 committed by GitHub
commit 5094c92418
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 139 additions and 36 deletions

120
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,120 @@
name: Release
on:
release:
types: [published]
jobs:
release-linux:
name: Release for Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
cache: yarn
- name: Build
run: |
make install
make clean
make build
- name: Package
env:
VERSION: ${{ github.event.release.name }}
run: |
make -e linux
- uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: "build/Whalebird-*.tar.bz2"
- uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: "build/Whalebird-*.AppImage"
- uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: "build/Whalebird-*.deb"
- uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: "build/Whalebird-*.rpm"
- uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: "build/Whalebird-*.shasum"
release-windows:
name: Release for Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
cache: yarn
- name: Build
run: |
make install
make clean
make build
- name: Package
env:
VERSION: ${{ github.event.release.name }}
run: |
make -e win32
make -e win64
- uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: "build/Whalebird-*.exe"
- uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: "build/Whalebird-*.shasum"
release-darwin:
name: Release for MacOS
runs-on: macos-11
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
cache: yarn
- name: Apple Codesigning
uses: apple-actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
- name: Build
run: |
make install
make clean
make build
- name: Package
env:
VERSION: ${{ github.event.release.name }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
ASC_PROVIDER: ${{ secrets.ASC_PROVIDER }}
TEAM_ID: ${{ secrets.ASC_PROVIDER }}
run: |
make -e mac
- uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: "build/Whalebird-*.dmg"
- uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: "build/Whalebird-*.shasum"

View File

@ -15,7 +15,7 @@ mac:
mv build/Whalebird-${VERSION}-mac-x64.dmg build/Whalebird-${VERSION}-darwin-x64.dmg
mv build/Whalebird-${VERSION}-mac-arm64.dmg build/Whalebird-${VERSION}-darwin-arm64.dmg
mv build/Whalebird-${VERSION}-mac-universal.dmg build/Whalebird-${VERSION}-darwin-universal.dmg
cd build; shasum -a 256 Whalebird-${VERSION}-darwin-universal.dmg >> sha256sum.txt
cd build; sha256sum Whalebird-${VERSION}-darwin-universal.dmg | awk '{ print $1 }' > Whalebird-${VERSION}-darwin-universal.dmg.shasum
mas:
yarn run build:clean
@ -26,29 +26,24 @@ linux:
yarn run package:linux
mv build/Whalebird-${VERSION}-linux-amd64.deb build/Whalebird-${VERSION}-linux-x64.deb
mv build/Whalebird-${VERSION}-linux-x86_64.rpm build/Whalebird-${VERSION}-linux-x64.rpm
mv build/Whalebird-${VERSION}-linux-i386.deb build/Whalebird-${VERSION}-linux-ia32.deb
mv build/Whalebird-${VERSION}-linux-i686.rpm build/Whalebird-${VERSION}-linux-ia32.rpm
mv build/Whalebird-${VERSION}-linux-x86_64.AppImage build/Whalebird-${VERSION}-linux-x64.AppImage
cd build; shasum -a 256 Whalebird-${VERSION}-linux-arm64.tar.bz2 >> sha256sum.txt
cd build; shasum -a 256 Whalebird-${VERSION}-linux-armv7l.tar.bz2 >> sha256sum.txt
cd build; shasum -a 256 Whalebird-${VERSION}-linux-i686.pacman >> sha256sum.txt
cd build; shasum -a 256 Whalebird-${VERSION}-linux-ia32.deb >> sha256sum.txt
cd build; shasum -a 256 Whalebird-${VERSION}-linux-ia32.rpm >> sha256sum.txt
cd build; shasum -a 256 Whalebird-${VERSION}-linux-x64.AppImage >> sha256sum.txt
cd build; shasum -a 256 Whalebird-${VERSION}-linux-x64.deb >> sha256sum.txt
cd build; shasum -a 256 Whalebird-${VERSION}-linux-x64.pacman >> sha256sum.txt
cd build; shasum -a 256 Whalebird-${VERSION}-linux-x64.rpm >> sha256sum.txt
cd build; shasum -a 256 Whalebird-${VERSION}-linux-x64.tar.bz2 >> sha256sum.txt
cd build; sha256sum Whalebird-${VERSION}-linux-arm64.tar.bz2 | awk '{ print $1 }' > Whalebird-${VERSION}-linux-arm64.tar.bz2.shasum
cd build; sha256sum Whalebird-${VERSION}-linux-armv7l.tar.bz2 | awk '{ print $1 }' > Whalebird-${VERSION}-linux-armv7l.tar.bz2.shasum
cd build; sha256sum Whalebird-${VERSION}-linux-x64.AppImage | awk '{ print $1 }' > Whalebird-${VERSION}-linux-x64.AppImage.shasum
cd build; sha256sum Whalebird-${VERSION}-linux-x64.deb | awk '{ print $1 }' > Whalebird-${VERSION}-linux-x64.deb.shasum
cd build; sha256sum Whalebird-${VERSION}-linux-x64.pacman | awk '{ print $1 }' > Whalebird-${VERSION}-linux-x64.pacman.shasum
cd build; sha256sum Whalebird-${VERSION}-linux-x64.rpm | awk '{ print $1 }' > Whalebird-${VERSION}-linux-x64.rpm.shasum
cd build; sha256sum Whalebird-${VERSION}-linux-x64.tar.bz2 | awk '{ print $1 }' > Whalebird-${VERSION}-linux-x64.tar.bz2.shasum
win32:
yarn run package:win32
mv build/Whalebird-${VERSION}-win-ia32.exe build/Whalebird-${VERSION}-windows-ia32.exe
cd build; shasum -a 256 Whalebird-${VERSION}-windows-ia32.exe >> sha256sum.txt
cd build; sha256sum Whalebird-${VERSION}-windows-ia32.exe | awk '{ print $1 }' > Whalebird-${VERSION}-windows-ia32.exe.shasum
win64:
yarn run package:win64
mv build/Whalebird-${VERSION}-win-x64.exe build/Whalebird-${VERSION}-windows-x64.exe
cd build; shasum -a 256 Whalebird-${VERSION}-windows-x64.exe >> sha256sum.txt
cd build; sha256sum Whalebird-${VERSION}-windows-x64.exe | awk '{ print $1 }' > Whalebird-${VERSION}-windows-x64.exe.shasum
clean:
yarn run build:clean

View File

@ -11,10 +11,10 @@ exports.default = async function notarizing(context) {
return await notarize({
tool: 'notarytool',
appBundleId: 'org.whalebird.desktop',
ascProvider: 'HB4N6B2YVM',
ascProvider: process.env.ASC_PROVIDER,
appPath: `${appOutDir}/${appName}.app`,
appleId: process.env.APPLE_ID,
appleIdPassword: process.env.APPLE_PASSWORD,
teamId: 'HB4N6B2YVM'
teamId: process.env.TEAM_ID
})
}

View File

@ -68,15 +68,13 @@
{
"target": "deb",
"arch": [
"x64",
"ia32"
"x64"
]
},
{
"target": "rpm",
"arch": [
"x64",
"ia32"
"x64"
]
},
{
@ -88,13 +86,6 @@
"arm64"
]
},
{
"target": "pacman",
"arch": [
"x64",
"ia32"
]
},
{
"target": "snap",
"arch": [

View File

@ -27,15 +27,12 @@
"build": "node .electron-vue/build.js",
"build:clean": "cross-env BUILD_TARGET=clean node .electron-vue/build.js",
"build:web": "cross-env BUILD_TARGET=web node .electron-vue/build.js",
"build:mac": "yarn run build && yarn run package:mac",
"build:linux": "yarn run build && yarn run package:linux",
"build:win32": "yarn run build && yarn run package:win32",
"build:win64": "yarn run build && yarn run package:win64",
"build:mas": "yarn run build:clean && yarn run pack && electron-packager ./ 'Whalebird' --platform=mas --arch=x64 --arch=arm64 --electron-version=16.0.4 --asar.unpackDir='build/sounds' --out=packages --ignore='^/src' --ignore='^/.electron-vue' --ignore='^/.envrc' --ignore='^/packages' --ignore='^/plist' --ignore='^/static' --ignore='^/whalebird.db' --ignore='^/screenshot.png' --prune=true --icon=./build/icons/icon.icns --overwrite --app-bundle-id=org.whalebird.desktop --app-version=$npm_package_config_appVersion --build-version=$npm_package_config_buildVersion --extend-info='./plist/team.plist' --app-category-type=public.app-category.social-networking && node ./packages/universal.js",
"package:mac": "electron-builder --mac --config electron-builder.json",
"package:linux": "electron-builder --linux --config electron-builder.json",
"package:win32": "electron-builder --win --ia32 --config electron-builder.json",
"package:win64": "electron-builder --win --x64 --config electron-builder.json",
"package:mac": "electron-builder --mac --publish never --config electron-builder.json",
"package:linux": "electron-builder --linux --publish never --config electron-builder.json",
"package:win32": "electron-builder --win --ia32 --publish never --config electron-builder.json",
"package:win64": "electron-builder --win --x64 --publish never --config electron-builder.json",
"package:pacman": "electron-builder --linux pacman --publish never --config electron-builder.json",
"pack": "yarn run pack:main && yarn run pack:renderer",
"pack:main": "webpack --node-env=production --mode production --progress --config .electron-vue/webpack.main.config.js",
"pack:renderer": "webpack --node-env=production --mode production --progress --config .electron-vue/webpack.renderer.config.js",