Skip to content

Commit

Permalink
ci(backend): release can be made manually
Browse files Browse the repository at this point in the history
  • Loading branch information
szattila98 committed Feb 27, 2024
1 parent 26ce274 commit da111be
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 159 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/conventional-commits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ name: Conventional commits

on:
push:
branches: ["main"]
branches: ["main", "ci"]
pull_request:
branches: ["**"]
types: [opened, synchronize]
workflow_dispatch:

jobs:
check:
Expand Down
156 changes: 0 additions & 156 deletions .github/workflows/deploy.yml

This file was deleted.

116 changes: 116 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: Publish

on:
push:
branches:
- ci # main
tags:
- "*"

env:
CARGO_TERM_COLOR: always

jobs:
upload_license:
name: Upload License
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/upload-artifact@v4
with:
name: LICENSE
path: LICENSE

build:
name: Build - ${{ matrix.platform }}
runs-on: ${{ matrix.platform }}
strategy:
matrix:
platform: [macos-latest, windows-latest, ubuntu-latest]

steps:
- uses: actions/checkout@v4

- uses: Swatinem/rust-cache@v2
with:
shared-key: whooosh-${{ matrix.platform }}
workspaces: src-tauri

- uses: volta-cli/action@v4

- uses: dtolnay/rust-toolchain@stable

- if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install libwebkit2gtk-4.0-dev \
build-essential \
curl \
wget \
file \
libssl-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev
- run: yarn install --immutable

- run: yarn tauri build --ci

- uses: actions/upload-artifact@v4
with:
name: artifact-${{ matrix.platform }}
path: src-tauri/target/release/bundle
retention-days: 7

upload_to_release:
needs: [build, upload_license]
name: Publish binaries
runs-on: ubuntu-latest
# if: ${{ github.ref_type == 'tag' }}
steps:
- uses: actions/download-artifact@v4

- run: ls -R

- name: Copy artifacts to archive
run: |
mv artifact-macos-latest macos
chmod +x -R macos
cp -r LICENSE macos/
tar -czf macos.tar.gz macos/*
mv artifact-windows-latest windows
chmod +x -R windows
cp -r LICENSE windows/
tar -czf windows.tar.gz windows/*
mv artifact-ubuntu-latest linux
chmod +x -R linux
cp -r LICENSE linux/
tar -czf linux.tar.gz linux/*
- uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: macos.tar.gz
tag: ${{ github.ref }}
asset_name: macos-${{ github.ref_name }}.tar.gz
body: "macos app and dmg"

- uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: windows.tar.gz
tag: ${{ github.ref }}
asset_name: windows-${{ github.ref_name }}.tar.gz
body: "windows msi and exe"

- uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: linux.tar.gz
tag: ${{ github.ref }}
asset_name: linux-${{ github.ref_name }}.tar.gz
body: "linux deb and appimage"
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Release

on:
push:
branches: ["main"]
branches: ["main", "ci"]
workflow_dispatch:

permissions:
Expand Down
2 changes: 1 addition & 1 deletion cog.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ignore_merge_commits = true
branch_whitelist = ["main"]
branch_whitelist = ["main", "ci"]
pre_bump_hooks = ["yarn install --immutable", "yarn version {{version}}"]
post_bump_hooks = ["git push", "git push origin --tags"]

Expand Down

0 comments on commit da111be

Please sign in to comment.