Skip to content

fix: auto update now works correctly (#2327) #110

fix: auto update now works correctly (#2327)

fix: auto update now works correctly (#2327) #110

Workflow file for this run

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
env:
CSC_FOR_PULL_REQUEST: true
CI: true
BUILD_SOURCE: 'github'
permissions:
contents: write
jobs:
release-build:
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: ⚙️ Install dependencies
uses: ./.github/workflows/install-pnpm
- name: Get tag name
uses: olegtarasov/[email protected] # Put version in GIT_TAG_NAME environment variable
with:
tagRegex: '^.(.*)$'
- name: Update package.json version
uses: jossef/action-set-json-field@v2
with:
file: package.json
field: version
value: ${{ env.GIT_TAG_NAME }}
- name: Add MacOS certs
if: startsWith(matrix.os, 'macos')
run: chmod +x .github/add_cert_in_keychain.sh && .github/add_cert_in_keychain.sh
env:
CERTIFICATE_OSX_APPLICATION: ${{ secrets.CERTIFICATE_OSX_APPLICATION }}
CERTIFICATE_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }}
- name: Build app
env:
# secrets for notarization
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASS: ${{ secrets.APPLE_ID_PASS }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
run: |
pnpm build
pnpm postbuild
pnpm dist
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: build-artifats
path: |
release/dist/*.exe
release/dist/*.dmg
release/dist/*.AppImage
release/dist/latest.yml
release/dist/latest-mac.yml
release/dist/latest-linux.yml
release/dist/*mac.zip
releas-project:
name: Release Nova Spektr build-project
runs-on: ubuntu-latest
needs: release-build
steps:
- name: Download build artifacts
uses: actions/download-artifact@v2
with:
name: build-artifats
- name: Debug
run: ls -la
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Replace space by "-"
run: |
for file in *; do
if [ -f "$file" ]; then
new_name=$(echo "$file" | tr ' ' '-')
if [ "$new_name" != "$file" ]; then # Skip files with no spaces
mv "$file" "$new_name"
fi
fi
done
- name: 🔐 Generate checksum
run: |
for filename in Nova*; do
shasum -a 256 "$filename" | awk '{print $1}' | tr -d '\n' > "${filename}.sha256"
done
- name: Release
uses: softprops/action-gh-release@v1
with:
name: 'Release ${{ steps.get_version.outputs.VERSION }}'
tag_name: ${{ github.ref }}
generate_release_notes: true
draft: true
files: |
*.dmg
*.exe
*.AppImage
*.sha256
latest*.yml
*mac.zip