wip: release yaml

This commit is contained in:
Jonathan Kelley 2024-02-21 19:50:39 -08:00
parent 8f70f8936f
commit 112b4f9afb
No known key found for this signature in database
GPG key ID: 1FBB50F7EB0A08BE

View file

@ -19,18 +19,17 @@ on:
inputs: inputs:
channel: channel:
type: choice type: choice
description: "Channel to publish" description: "Branch to publish"
required: true required: true
description: Publish crates, extension, CLI, and docs description: Choose the branch to publish. If the branch is main, it will publish a prerelease.
# add more options as we release more stable versions.
# todo: automate branch selection
options: options:
- v0.4.x - v0.4.x
- v0.5.x - v0.5.x
- main - main
# todo: use better name scheme
# - stable # the currently released version of dioxus
# - prerelease # the next version of dioxus, which we release slowly
jobs: jobs:
# Build the CLI for all platforms # Build the CLI for all platforms
build-cli: build-cli:
@ -57,21 +56,19 @@ jobs:
} }
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
ref: ${{ github.event.inputs.channel }}
- name: Install stable - name: Install stable
uses: dtolnay/rust-toolchain@master uses: dtolnay/rust-toolchain@master
with: with:
toolchain: ${{ matrix.platform.toolchain }} toolchain: ${{ matrix.platform.toolchain }}
targets: ${{ matrix.platform.target }} targets: ${{ matrix.platform.target }}
- uses: ilammy/setup-nasm@v1 - uses: ilammy/setup-nasm@v1
# Setup the Github Actions Cache for the CLI package
- name: Setup cache - name: Setup cache
uses: Swatinem/rust-cache@v2 uses: Swatinem/rust-cache@v2
# cache only the cli - mmmm not sure if this is needed
with: with:
workspaces: packages/cli -> ../../target workspaces: packages/cli -> ../../target
#
# Build the vscode extension # Build the vscode extension
build-extension: build-extension:
@ -83,15 +80,24 @@ jobs:
# And then do the releases, once everything is built # And then do the releases, once everything is built
# This should involve no rust and just pull down the artifacts
release: release:
depends-on: [build-cli, build-extension, build-docs, build-benchmarks] depends-on: [build-cli, build-extension, build-docs, build-benchmarks]
# Checkout the right branch
- uses: actions/checkout@v4
ref: ${{ github.event.inputs.channel }}
# Before anything else, we need to publish the crates # Before anything else, we need to publish the crates
# todo: set the semver based on the channel
# - all semver is a minor bump,
# - if it's main, it's a prerelease, so use the prerelease flag
- name: Publish to crates.io - name: Publish to crates.io
run: | run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com" git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]" git config --global user.name "github-actions[bot]"
cargo workspaces publish -y ${{ github.event.inputs.semver }} # cargo workspaces version -y ${{ github.event.inputs.semver }}
# cargo workspaces publish -y ${{ github.event.inputs.semver }}
# Todo: we want `cargo install dx` to actually just use a prebuilt binary # Todo: we want `cargo install dx` to actually just use a prebuilt binary
- name: Build and upload CLI binaries - name: Build and upload CLI binaries
@ -118,7 +124,7 @@ jobs:
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2
with: with:
cache-all-crates: "true" cache-all-crates: "true"
save-if: ${{ github.ref == 'refs/heads/main' }} # save-if: ${{ github.ref == 'refs/heads/main' }} # always save the cache
- name: Free Disk Space (Ubuntu) - name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@v1.3.1 uses: jlumbroso/free-disk-space@v1.3.1