Skip to content

dispatch-main

dispatch-main #42

Workflow file for this run

name: Deploy
on:
repository_dispatch:
types: ["dispatch-main"]
jobs:
preprocessing:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Update package.json
run: |
cat package.json | jq ".version = \"$RELEASE_VERSION\"" | jq ".dbvtkVersion = \"$RELEASE_VERSION\"" > tmp
mv tmp package.json
env:
RELEASE_VERSION: ${{ github.event.client_payload.version }}
- name: Cache package.json
uses: actions/cache/save@v3
with:
path: package.json
key: ${{ github.event.client_payload.version }}-package.json
enableCrossOsArchive: true
build:
needs: preprocessing
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'
- name: Cache restore
uses: actions/cache/restore@v3
with:
path: package.json
key: ${{ github.event.client_payload.version }}-package.json
enableCrossOsArchive: true
- name: Package
run: yarn --link-duplicates --pure-lockfile && yarn dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DBPTK_UI_VERSION: ${{ github.event.client_payload.version }}
FLOW: ${{ github.event.client_payload.flow }}
RUNNER_OS: ${{ runner.os }}
- name: Upload dist artifacts
uses: actions/upload-artifact@v3
with:
name: artifact
path: |
dist/*
!dist/linux-unpacked/*
!dist/win-unpacked/*
!dist/win-ia32-unpacked/*
!dist/mac/*
!dist/*.zip
!dist/*.blockmap
!dis/builder-debug.yml
retention-days: 1
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: artifact
- name: Release to GitHub
uses: softprops/action-gh-release@v1
with:
files: |
dist/dbptk-desktop-${{ github.event.client_payload.version }}.AppImage
dist/dbptk-desktop-${{ github.event.client_payload.version }}.exe
dist/dbptk-desktop-${{ github.event.client_payload.version }}.dmg
dist/latest*
name: Version ${{ github.event.client_payload.version }}
tag_name: v${{ github.event.client_payload.version }}
draft: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to Snap
uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
with:
snap: dist/dbptk-desktop-${{ github.event.client_payload.version }}.snap
release: stable
update:
needs: deploy
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set GitHub config
run: |
git config --local user.email "[email protected]"
git config --local user.name "Miguel Guimarães"
- name: Run release script
run: ./scripts/release.sh $TAG
env:
TAG: ${{ github.event.client_payload.version }}
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}