gitbutler/.github/workflows/publish.yaml
2023-02-20 17:13:49 +01:00

83 lines
3.1 KiB
YAML

name: "Publish"
on:
workflow_dispatch:
inputs:
bump:
type: choice
required: true
description: update type
options:
- undefined
- patch
- minor
- major
jobs:
publish-tauri:
strategy:
fail-fast: false
matrix:
platform:
# - macos-latest
- macos-aarch64
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 7.x.x
run_install: |
args: ["--frozen-lockfile"]
- name: Setup rust
uses: dtolnay/rust-toolchain@stable
- name: Set env variable with version
run: |
CURRENT_VERSION="$(curl --silent "https://app.gitbutler.com/releases" | jq -r '.version')"
NEXT_VERSION=$(./scripts/next.sh "${CURRENT_VERSION}" "${{ github.event.inputs.bump }}")
echo "version=$NEXT_VERSION" >> $GITHUB_ENV
- name: Build binary
run: |
./scripts/release.sh \
--sign \
--dist "./release" \
--version "${{ env.version }}" \
--tauri-private-key "${{ secrets.TAURI_PRIVATE_KEY }}" \
--tauri-key-password "${{ secrets.TAURI_KEY_PASSWORD }}" \
--apple-certificate "${{ secrets.APPLE_CERTIFICATE }}" \
--apple-certificate-password "${{ secrets.APPLE_CERTIFICATE_PASSWORD }}" \
--apple-signing-identity "${{ secrets.APPLE_SIGNING_IDENTITY }}" \
--apple-id "${{ secrets.APPLE_ID }}" \
--apple-password "${{ secrets.APPLE_PASSWORD }}"
- uses: shallwefootball/s3-upload-action@master
name: Upload To S3
id: S3
with:
aws_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
aws_bucket: "releases.gitbutler.com"
source_dir: "release/"
destination_dir: "releases/${{ env.version }}-${{ github.run_number }}"
# tell our server to update with the version number
- name: Tell our server to update
run: |
curl 'https://app.gitbutler.com/api/releases' \
--fail \
--request POST \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: ${{ secrets.BOT_AUTH_TOKEN }}' \
--data '{"version":"${{ env.version }}-${{ github.run_number }}"}'