Skip to content

Commit

Permalink
Update github/workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
fuyutarow committed Jun 5, 2021
1 parent effd9fa commit a1b61d1
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 146 deletions.
30 changes: 0 additions & 30 deletions .github/workflows/on_PR_closing.yml

This file was deleted.

110 changes: 0 additions & 110 deletions .github/workflows/release-partiql-cli-cargodist.yml

This file was deleted.

38 changes: 34 additions & 4 deletions .github/workflows/release-pq-cargodist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
6 changes: 6 additions & 0 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a1b61d1

Please sign in to comment.