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: Install pnpm uses: pnpm/action-setup@v2 with: version: 7.x.x run_install: false - name: Get pnpm store directory id: pnpm-cache shell: bash run: | echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT - uses: actions/cache@v3 name: Setup pnpm cache with: path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-pnpm-store- - name: Install pnpm dependencies run: pnpm install - name: Setup rust uses: dtolnay/rust-toolchain@stable - name: Cache rust dependencies uses: actions/cache@v3 with: path: | ~/.cargo/bin/ ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ src-tauri/target/ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - 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 }}","sha":"${{ github.sha }}"}'