diff --git a/.github/workflows/on_PR_closing.yml b/.github/workflows/on_PR_closing.yml deleted file mode 100644 index e1a94c3..0000000 --- a/.github/workflows/on_PR_closing.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: make-version - -on: - pull_request: - branches: - - alpha - types: [closed] - -jobs: - update: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Setup Rust - uses: hecrj/setup-rust-action@v1 - - name: Update version - run: | - wget "https://github.com/fuyutarow/version-make/releases/download/v0.202005.1/version-make-v0.202005.1-x86_64-linux.zip" -O version-make.zip - unzip version-make.zip - ./version-make up -rz Cargo.toml - cargo build - - name: Commit and push - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git pull - git commit -am "Update version" - git tag v$(./version-make show Cargo.toml) - git push diff --git a/.github/workflows/release-partiql-cli-cargodist.yml b/.github/workflows/release-partiql-cli-cargodist.yml deleted file mode 100644 index a224f1e..0000000 --- a/.github/workflows/release-partiql-cli-cargodist.yml +++ /dev/null @@ -1,110 +0,0 @@ -name: Release - -on: - push: - tags: - - "v*.*.*" - -jobs: - build: - strategy: - matrix: - os: [ubuntu-latest, macOS-latest] - rust: [stable] - - runs-on: ${{ matrix.os }} - - steps: - - name: Set envs - id: set_envs - run: | - echo ::set-output name=bin_name::partiql-cli - echo ::set-output name=version::${GITHUB_REF/refs\/tags\//} - env: - GITHUB_REF: ${{ github.ref }} - - name: Setup Rust - uses: hecrj/setup-rust-action@v1 - with: - rust-version: ${{ matrix.rust }} - - name: Checkout - uses: actions/checkout@v1 - - name: Build for Linux - if: matrix.os == 'ubuntu-latest' - id: build_linux - run: | - BIN_ZIP=./${BIN_NAME}-${VERSION}-x86_64-linux.zip - rustup target add x86_64-unknown-linux-musl - sudo apt-get -qq install musl-tools - cargo build --locked --release --target=x86_64-unknown-linux-musl --bin partiql-cli - zip -j ${BIN_ZIP} target/x86_64-unknown-linux-musl/release/${BIN_NAME} - echo "::set-output name=sha::$(shasum -a 256 ${BIN_ZIP} |awk '{print $1}')" - env: - BIN_NAME: ${{ steps.set_envs.outputs.bin_name }} - VERSION: ${{ steps.set_envs.outputs.version }} - - name: Build for macOS - if: matrix.os == 'macOS-latest' - id: build_mac - run: | - BIN_ZIP=./${BIN_NAME}-${VERSION}-x86_64-mac.zip - cargo build --locked --release --target=x86_64-apple-darwin --bin partiql-cli - zip -j ${BIN_ZIP} target/x86_64-apple-darwin/release/${BIN_NAME} - echo "::set-output name=sha::$(shasum -a 256 ${BIN_ZIP} |awk '{print $1}')" - env: - BIN_NAME: ${{ steps.set_envs.outputs.bin_name }} - VERSION: ${{ steps.set_envs.outputs.version }} - - name: Release - uses: softprops/action-gh-release@v1 - with: - files: "*.zip\n*.rpm" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Dispatch homebrew Repository update for Linux - if: matrix.os == 'ubuntu-latest' - uses: peter-evans/repository-dispatch@v1 - with: - token: ${{ secrets.HOMEBREW_REPO_GITHUB_TOKEN }} - repository: fuyutarow/homebrew-tap - event-type: update - client-payload: | - { - "type": "update_sha", - "os": "linux", - "bin_name": "${{ steps.set_envs.outputs.bin_name }}", - "version": "${{ steps.set_envs.outputs.version }}", - "sha": "${{ steps.build_linux.outputs.sha }}" - } - - name: Dispatch homebrew Repository update for mac - if: matrix.os == 'macOS-latest' - uses: peter-evans/repository-dispatch@v1 - with: - token: ${{ secrets.HOMEBREW_REPO_GITHUB_TOKEN }} - repository: fuyutarow/homebrew-tap - event-type: update - client-payload: | - { - "type": "update_sha", - "os": "mac", - "bin_name": "${{ steps.set_envs.outputs.bin_name }}", - "version": "${{ steps.set_envs.outputs.version }}", - "sha": "${{ steps.build_mac.outputs.sha }}" - } - - final: - runs-on: ubuntu-latest - needs: build - steps: - - name: Set envs - id: set_envs - run: | - echo ::set-output name=bin_name::partiql-cli - - name: Dispatch homebrew Repository final - uses: peter-evans/repository-dispatch@v1 - with: - token: ${{ secrets.HOMEBREW_REPO_GITHUB_TOKEN }} - repository: fuyutarow/homebrew-tap - event-type: update - client-payload: | - { - "type": "update_formula", - "bin_name": "${{ steps.set_envs.outputs.bin_name }}" - } diff --git a/.github/workflows/release-pq-cargodist.yml b/.github/workflows/release-pq-cargodist.yml index f634217..d95af49 100644 --- a/.github/workflows/release-pq-cargodist.yml +++ b/.github/workflows/release-pq-cargodist.yml @@ -9,7 +9,7 @@ jobs: build: strategy: matrix: - os: [ubuntu-latest, macOS-latest] + os: [ubuntu-latest, macOS-latest, windows-latest] rust: [stable] runs-on: ${{ matrix.os }} @@ -28,11 +28,12 @@ jobs: rust-version: ${{ matrix.rust }} - name: Checkout uses: actions/checkout@v1 - - name: Build for Linux + - name: Build for linux if: matrix.os == 'ubuntu-latest' id: build_linux run: | BIN_ZIP=./${BIN_NAME}-${VERSION}-x86_64-linux.zip + rustup default nightly rustup target add x86_64-unknown-linux-musl sudo apt-get -qq install musl-tools cargo build --locked --release --target=x86_64-unknown-linux-musl --bin pq @@ -46,19 +47,33 @@ jobs: id: build_mac run: | BIN_ZIP=./${BIN_NAME}-${VERSION}-x86_64-mac.zip + rustup default nightly cargo build --locked --release --target=x86_64-apple-darwin --bin pq zip -j ${BIN_ZIP} target/x86_64-apple-darwin/release/${BIN_NAME} echo "::set-output name=sha::$(shasum -a 256 ${BIN_ZIP} |awk '{print $1}')" env: BIN_NAME: ${{ steps.set_envs.outputs.bin_name }} VERSION: ${{ steps.set_envs.outputs.version }} + - name: Build for windows + if: matrix.os == 'windows-latest' + id: build_windows + run: | + rustup default stable-x86_64-pc-windows-msvc + rustup default nightly + cargo build --locked --release + # 7z a pq-x86_64-pc-windows-msvc.zip target/release/pq.exe + mv ./target/release/pq.exe . + echo "::set-output name=sha::$(Get-FileHash pq.exe | Select-Object Hash)" - name: Release uses: softprops/action-gh-release@v1 with: - files: "*.zip\n*.rpm" + files: | + *.zip + *.rpm + *.exe env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Dispatch homebrew Repository update for Linux + - name: Dispatch homebrew Repository update for linux if: matrix.os == 'ubuntu-latest' uses: peter-evans/repository-dispatch@v1 with: @@ -88,6 +103,21 @@ jobs: "version": "${{ steps.set_envs.outputs.version }}", "sha": "${{ steps.build_mac.outputs.sha }}" } + - name: Dispatch homebrew Repository update for windows + if: matrix.os == 'windows-latest' + uses: peter-evans/repository-dispatch@v1 + with: + token: ${{ secrets.HOMEBREW_REPO_GITHUB_TOKEN }} + repository: fuyutarow/homebrew-tap + event-type: update + client-payload: | + { + "type": "update_sha", + "os": "windows", + "bin_name": "${{ steps.set_envs.outputs.bin_name }}", + "version": "${{ steps.set_envs.outputs.version }}", + "sha": "${{ steps.build_mac.outputs.sha }}" + } final: runs-on: ubuntu-latest diff --git a/Cargo.lock b/Cargo.lock index 1949fac..fcb9652 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1073,7 +1073,7 @@ dependencies = [ [[package]] name = "partiql-rs" -version = "0.202106.0" +version = "0.202106.1" dependencies = [ "anyhow", "atty", diff --git a/Cargo.toml b/Cargo.toml index 82329f2..5799234 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "partiql-rs" -version = "0.202106.0" +version = "0.202106.1" edition = "2018" description = "A implementation of PartiQL" homepage = "https://github.com/fuyutarow/partiql-rs" diff --git a/Makefile.toml b/Makefile.toml index dac85b6..62f0953 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -37,6 +37,12 @@ script = ''' tests-make tests-make.toml ''' +[tasks.update-tap] +script = ''' +cargo-distribute --tap ~/homebrew-tap/ --channel nightly --bin pq +''' + + [tasks.up] script = ''' git remote add upstream https://github.com/fuyutarow/partiql-rs