feature/sdk-workflows
claude/smbcloud-github-app-k9641p
development
feature/apps
feature/build-release
feature/ci-docs
feature/ci-ruby-gems
feature/cicd
feature/completion
feature/dist-nuget
feature/fix-ci-sdk-pypi-rubygem
feature/fix-clippy-on-stable-channel
feature/fix-deployment-script
feature/github-email
feature/gresiq-v1
feature/project-new-structure
feature/rsync-deploy
feature/ruby-runner
feature/sdk-npm
feature/sdk-workflows
feature/smbcloud-cli-release-npm
feature/smbcloud-deploy
feature/wasm
main
release/v0.7.4
| 1 | name: GitHub CLI Release |
| 2 | |
| 3 | on: |
| 4 | workflow_dispatch: |
| 5 | inputs: |
| 6 | tag: |
| 7 | description: "Release tag (e.g. v0.3.39)" |
| 8 | required: true |
| 9 | |
| 10 | permissions: |
| 11 | contents: write |
| 12 | actions: write |
| 13 | |
| 14 | env: |
| 15 | PROJECT_NAME: smb |
| 16 | CARGO_TERM_COLOR: always |
| 17 | CLI_CLIENT_SECRET: ${{ secrets.CLI_CLIENT_SECRET }} |
| 18 | |
| 19 | jobs: |
| 20 | build: |
| 21 | name: Build binary (${{ matrix.name }}) |
| 22 | runs-on: ${{ matrix.runner }} |
| 23 | |
| 24 | strategy: |
| 25 | fail-fast: false |
| 26 | matrix: |
| 27 | include: |
| 28 | - name: linux-amd64 |
| 29 | runner: ubuntu-latest |
| 30 | target: x86_64-unknown-linux-gnu |
| 31 | - name: linux-arm64 |
| 32 | runner: ubuntu-24.04-arm |
| 33 | target: aarch64-unknown-linux-gnu |
| 34 | - name: win-amd64 |
| 35 | runner: windows-latest |
| 36 | target: x86_64-pc-windows-msvc |
| 37 | - name: win-arm64 |
| 38 | runner: windows-latest |
| 39 | target: aarch64-pc-windows-msvc |
| 40 | - name: macos-amd64 |
| 41 | runner: macos-15-intel |
| 42 | target: x86_64-apple-darwin |
| 43 | - name: macos-arm64 |
| 44 | runner: macos-latest |
| 45 | target: aarch64-apple-darwin |
| 46 | |
| 47 | steps: |
| 48 | - name: Checkout |
| 49 | uses: actions/checkout@v6 |
| 50 | with: |
| 51 | ref: ${{ github.event.inputs.tag || github.ref }} |
| 52 | |
| 53 | - name: Set the release version |
| 54 | shell: bash |
| 55 | run: | |
| 56 | if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then |
| 57 | release_version="${GITHUB_REF_NAME#v}" |
| 58 | else |
| 59 | release_version="${{ github.event.inputs.tag }}" |
| 60 | release_version="${release_version#v}" |
| 61 | fi |
| 62 | |
| 63 | echo "RELEASE_VERSION=${release_version}" >> "$GITHUB_ENV" |
| 64 | |
| 65 | - name: Read Rust toolchain |
| 66 | shell: bash |
| 67 | run: | |
| 68 | rust_toolchain="$(sed -n 's/^channel = "\(.*\)"/\1/p' rust-toolchain.toml | head -n 1)" |
| 69 | if [ -z "$rust_toolchain" ]; then |
| 70 | echo "Failed to read Rust toolchain from rust-toolchain.toml" >&2 |
| 71 | exit 1 |
| 72 | fi |
| 73 | |
| 74 | echo "RUST_TOOLCHAIN=${rust_toolchain}" >> "$GITHUB_ENV" |
| 75 | |
| 76 | - name: Install toolkit |
| 77 | uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 |
| 78 | with: |
| 79 | toolchain: ${{ env.RUST_TOOLCHAIN }} |
| 80 | targets: ${{ matrix.target }} |
| 81 | |
| 82 | - name: Setup Rust cache |
| 83 | uses: Swatinem/rust-cache@v2 |
| 84 | with: |
| 85 | key: github-${{ matrix.target }} |
| 86 | |
| 87 | - name: Build binary |
| 88 | shell: bash |
| 89 | run: cargo build --locked --release --target ${{ matrix.target }} --package smbcloud-cli |
| 90 | |
| 91 | - name: Package binary |
| 92 | shell: bash |
| 93 | run: | |
| 94 | BIN_SUFFIX="" |
| 95 | if [[ "${{ matrix.runner }}" == "windows-latest" ]]; then |
| 96 | BIN_SUFFIX=".exe" |
| 97 | fi |
| 98 | |
| 99 | BIN_OUTPUT="target/${{ matrix.target }}/release/${PROJECT_NAME}${BIN_SUFFIX}" |
| 100 | BIN_RELEASE="${PROJECT_NAME}-${{ matrix.name }}${BIN_SUFFIX}" |
| 101 | |
| 102 | mkdir -p ./release |
| 103 | mv "${BIN_OUTPUT}" "./release/${BIN_RELEASE}" |
| 104 | |
| 105 | - name: Package macOS tarball for Homebrew |
| 106 | if: contains(matrix.target, 'apple-darwin') |
| 107 | shell: bash |
| 108 | run: | |
| 109 | ARCHIVE_NAME="${PROJECT_NAME}-${{ matrix.name }}.tar.gz" |
| 110 | |
| 111 | mkdir -p staging-brew |
| 112 | cp "./release/${PROJECT_NAME}-${{ matrix.name }}" "staging-brew/${PROJECT_NAME}" |
| 113 | strip "staging-brew/${PROJECT_NAME}" |
| 114 | |
| 115 | tar -C staging-brew -czf "${ARCHIVE_NAME}" "${PROJECT_NAME}" |
| 116 | |
| 117 | shasum -a 256 "${ARCHIVE_NAME}" | awk '{print $1}' > "${ARCHIVE_NAME}.sha256" |
| 118 | |
| 119 | echo "Archive: ${ARCHIVE_NAME}" |
| 120 | echo "SHA256: $(cat "${ARCHIVE_NAME}.sha256")" |
| 121 | |
| 122 | - name: Upload binary artifact |
| 123 | uses: actions/upload-artifact@v7 |
| 124 | with: |
| 125 | name: binary-${{ matrix.name }} |
| 126 | path: release/* |
| 127 | |
| 128 | - name: Upload macOS Homebrew artifacts |
| 129 | if: contains(matrix.target, 'apple-darwin') |
| 130 | uses: actions/upload-artifact@v7 |
| 131 | with: |
| 132 | name: homebrew-${{ matrix.name }} |
| 133 | path: | |
| 134 | ${{ env.PROJECT_NAME }}-${{ matrix.name }}.tar.gz |
| 135 | ${{ env.PROJECT_NAME }}-${{ matrix.name }}.tar.gz.sha256 |
| 136 | |
| 137 | release: |
| 138 | name: Create GitHub Release |
| 139 | needs: build |
| 140 | runs-on: ubuntu-latest |
| 141 | if: github.ref_type == 'tag' || github.event_name == 'workflow_dispatch' |
| 142 | |
| 143 | steps: |
| 144 | - name: Resolve tag |
| 145 | id: tag |
| 146 | shell: bash |
| 147 | run: | |
| 148 | if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then |
| 149 | echo "tag=${{ github.event.inputs.tag }}" >> "$GITHUB_OUTPUT" |
| 150 | else |
| 151 | echo "tag=${{ github.ref_name }}" >> "$GITHUB_OUTPUT" |
| 152 | fi |
| 153 | |
| 154 | - name: Download binary artifacts |
| 155 | uses: actions/download-artifact@v7 |
| 156 | with: |
| 157 | pattern: "binary-*" |
| 158 | path: release |
| 159 | merge-multiple: true |
| 160 | |
| 161 | - name: Download Homebrew artifacts |
| 162 | uses: actions/download-artifact@v7 |
| 163 | with: |
| 164 | pattern: "homebrew-*" |
| 165 | path: release |
| 166 | merge-multiple: true |
| 167 | |
| 168 | - name: Release |
| 169 | uses: softprops/action-gh-release@v2 |
| 170 | with: |
| 171 | tag_name: ${{ steps.tag.outputs.tag }} |
| 172 | files: release/* |
| 173 | |
| 174 | - name: Trigger Homebrew release |
| 175 | uses: actions/github-script@v7 |
| 176 | with: |
| 177 | script: | |
| 178 | await github.rest.actions.createWorkflowDispatch({ |
| 179 | owner: context.repo.owner, |
| 180 | repo: context.repo.repo, |
| 181 | workflow_id: 'release-homebrew.yml', |
| 182 | ref: '${{ steps.tag.outputs.tag }}', |
| 183 | inputs: { |
| 184 | tag: '${{ steps.tag.outputs.tag }}' |
| 185 | } |
| 186 | }) |
| 187 | console.log('Dispatched release-homebrew.yml for tag ${{ steps.tag.outputs.tag }}') |