Skip to content

Commit

Permalink
Change architecture (#147)
Browse files Browse the repository at this point in the history
* Change architecture

* Format

* Remove workflows for Windows

* Fix tests

* Update CHANGES.md

* Delete AUTHORS

* Fix docker-compose.yml
  • Loading branch information
mosuka authored Aug 3, 2022
1 parent c0248c2 commit 4a6c957
Show file tree
Hide file tree
Showing 298 changed files with 19,894 additions and 30,594 deletions.
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: cargo
directory: /
schedule:
interval: daily
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
5 changes: 3 additions & 2 deletions .github/workflows/periodic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ jobs:
name: Test
strategy:
matrix:
os: [ubuntu-latest]
# os: [ubuntu-latest, macOS-latest, windows-latest]
os: [ubuntu-latest, macOS-latest]
toolchain: [stable, beta, nightly]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
toolchain: [stable]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
Expand All @@ -30,11 +30,12 @@ jobs:
name: Test
strategy:
matrix:
os: [ubuntu-latest]
# os: [ubuntu-latest, macOS-latest, windows-latest]
os: [ubuntu-latest, macOS-latest]
toolchain: [stable]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
Expand All @@ -52,7 +53,7 @@ jobs:
toolchain: [stable]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
profile: minimal
Expand Down
279 changes: 107 additions & 172 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,126 +7,135 @@ on:
- "v*.*.*"

jobs:
# build:
# name: Build
# strategy:
# matrix:
# target:
# - x86_64-unknown-linux-musl
# include:
# - target: x86_64-unknown-linux-musl
# os: ubuntu-latest
# toolchain: [stable]
# runs-on: ${{ matrix.os }}
# steps:
# - uses: actions/checkout@v2
# - uses: actions/cache@v1
# with:
# path: ~/.cargo/registry
# key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
# - uses: actions/cache@v1
# with:
# path: ~/.cargo/git
# key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
# - uses: actions/cache@v1
# with:
# path: target
# key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
# - uses: actions-rs/toolchain@v1
# with:
# toolchain: ${{ matrix.toolchain }}
# override: true
# target: ${{ matrix.target }}
# - run: |
# sudo apt-get install -y musl-tools build-essential
# sudo mkdir /musl
# sudo ln -s /usr/include/x86_64-linux-gnu/asm /usr/include/x86_64-linux-musl/asm && \
# sudo ln -s /usr/include/asm-generic /usr/include/x86_64-linux-musl/asm-generic && \
# sudo ln -s /usr/include/linux /usr/include/x86_64-linux-musl/linux
# wget https://github.com/openssl/openssl/archive/OpenSSL_1_1_1g.tar.gz
# tar zxvf OpenSSL_1_1_1g.tar.gz
# cd openssl-OpenSSL_1_1_1g/
# sudo CC="musl-gcc -fPIE -pie" ./Configure no-shared no-async --prefix=/musl --openssldir=/musl/ssl linux-x86_64
# sudo make depend
# sudo make -j$(nproc)
# sudo make install
# - run: |
# echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV
# echo "OPENSSL_STATIC=true" >> $GITHUB_ENV
# echo "OPENSSL_DIR=/musl" >> $GITHUB_ENV
# echo "CMAKE_CXX_COMPILER=musl-g++" >> $GITHUB_ENV
# - uses: actions-rs/[email protected]
# with:
# crate: cross
# version: 0.1.16
# - uses: actions-rs/cargo@v1
# with:
# command: build
# args: --release --target=${{ matrix.target }}
# use-cross: true
# - if: matrix.os == 'ubuntu-latest'
# run: |
# zip --junk-paths bayard-${{ matrix.target }}.zip target/${{ matrix.target }}/release/bayard target/${{ matrix.target }}/release/bayard-rest target/${{ matrix.target }}/release/bayard-cli
# - uses: actions/upload-artifact@v1
# with:
# name: build-${{ matrix.target }}
# path: bayard-${{ matrix.target }}.zip
build:
name: Build
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- x86_64-apple-darwin
# - x86_64-pc-windows-msvc
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-latest
# - target: x86_64-pc-windows-msvc
# os: windows-latest
toolchain: [stable]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache ~/.cargo/registry
uses: actions/cache@v2
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache ~/.cargo/git
uses: actions/cache@v2
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache target
uses: actions/cache@v2
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
override: true
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release --target=${{ matrix.target }}
use-cross: false
- name: Create artifact for Linux
if: matrix.os == 'ubuntu-latest'
run: |
zip --junk-paths bayard-${{ matrix.target }}.zip \
target/${{ matrix.target }}/release/bayard
- name: Create artifact for OSX
if: matrix.os == 'macos-latest'
run: |
zip --junk-paths bayard-${{ matrix.target }}.zip \
target/${{ matrix.target }}/release/lindera
# - name: Create artifact for Windows
# if: matrix.os == 'windows-latest'
# run: |
# powershell Compress-Archive -DestinationPath bayard-${{ matrix.target }}.zip -Path target/${{ matrix.target }}/release/*.exe
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: build-${{ matrix.target }}
path: bayard-${{ matrix.target }}.zip

create-release:
name: Create Release
# needs: [build]
needs: [build]
runs-on: ubuntu-latest
steps:
- id: create-release
- name: Create release
uses: actions/create-release@v1
id: create-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- run: |
- name: Create release_upload_url.txt
run: |
echo '${{ steps.create-release.outputs.upload_url }}' > release_upload_url.txt
- uses: actions/upload-artifact@v1
- name: Upload release_upload_url.txt
uses: actions/[email protected]
with:
name: create-release
path: release_upload_url.txt

# upload-release:
# strategy:
# matrix:
# target:
# - x86_64-unknown-linux-musl
# name: Upload Release
# needs: [create-release]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/download-artifact@v1
# with:
# name: create-release
# - id: upload-url
# run: |
# echo "::set-output name=url::$(cat create-release/release_upload_url.txt)"
# - uses: actions/download-artifact@v1
# with:
# name: build-${{ matrix.target }}
# - uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.upload-url.outputs.url }}
# asset_path: ./build-${{ matrix.target }}/bayard-${{ matrix.target }}.zip
# asset_name: bayard-${{ matrix.target }}.zip
# asset_content_type: application/zip
upload-release:
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- x86_64-apple-darwin
# - x86_64-pc-windows-msvc
name: Upload Release
needs: [create-release]
runs-on: ubuntu-latest
steps:
- name: Download release_upload_url.txt
uses: actions/download-artifact@v1
with:
name: create-release
- id: upload-url
run: |
echo "::set-output name=url::$(cat create-release/release_upload_url.txt)"
- name: Download artifact
uses: actions/download-artifact@v1
with:
name: build-${{ matrix.target }}
- name: Upload release assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.upload-url.outputs.url }}
asset_path: ./build-${{ matrix.target }}/bayard-${{ matrix.target }}.zip
asset_name: bayard-${{ matrix.target }}.zip
asset_content_type: application/zip

publish-crates:
name: Publish crate
strategy:
matrix:
os: [ubuntu-latest]
toolchain: [stable]
# needs: [upload-release]
needs: [upload-release]
needs: [create-release]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -137,56 +146,6 @@ jobs:
toolchain: ${{ matrix.toolchain }}
override: true
- run: |
BAYARD_COMMON_VERSION=$(cargo metadata --no-deps --format-version=1 | jq -r '.packages[] | select(.name=="bayard-common") | .version')
BAYARD_COMMON_VERSIONS=$(curl -s -XGET https://crates.io/api/v1/crates/bayard-common | jq -r '.versions[].num')
if echo ${BAYARD_COMMON_VERSIONS} | grep ${BAYARD_COMMON_VERSION} >/dev/null; then
echo "bayard-common ${BAYARD_COMMON_VERSION} has already published"
else
pushd bayard-common
cargo publish --token ${{ secrets.CRATES_TOKEN }}
popd
fi
sleep 20
BAYARD_SERVER_VERSION=$(cargo metadata --no-deps --format-version=1 | jq -r '.packages[] | select(.name=="bayard-server") | .version')
BAYARD_SERVER_VERSIONS=$(curl -s -XGET https://crates.io/api/v1/crates/bayard-server | jq -r '.versions[].num')
if echo ${BAYARD_SERVER_VERSIONS} | grep ${BAYARD_SERVER_VERSION} >/dev/null; then
echo "bayard-server ${BAYARD_SERVER_VERSION} has already published"
else
pushd bayard-server
cargo publish --token ${{ secrets.CRATES_TOKEN }}
popd
fi
sleep 20
BAYARD_CLIENT_VERSION=$(cargo metadata --no-deps --format-version=1 | jq -r '.packages[] | select(.name=="bayard-client") | .version')
BAYARD_CLIENT_VERSIONS=$(curl -s -XGET https://crates.io/api/v1/crates/bayard-client | jq -r '.versions[].num')
if echo ${BAYARD_CLIENT_VERSIONS} | grep ${BAYARD_CLIENT_VERSION} >/dev/null; then
echo "bayard-client ${BAYARD_CLIENT_VERSION} has already published"
else
pushd bayard-client
cargo publish --token ${{ secrets.CRATES_TOKEN }}
popd
fi
sleep 20
BAYARD_CLI_VERSION=$(cargo metadata --no-deps --format-version=1 | jq -r '.packages[] | select(.name=="bayard-cli") | .version')
BAYARD_CLI_VERSIONS=$(curl -s -XGET https://crates.io/api/v1/crates/bayard-cli | jq -r '.versions[].num')
if echo ${BAYARD_CLI_VERSIONS} | grep ${BAYARD_CLI_VERSION} >/dev/null; then
echo "bayard-cli ${BAYARD_CLI_VERSION} has already published"
else
pushd bayard-cli
cargo publish --token ${{ secrets.CRATES_TOKEN }}
popd
fi
sleep 20
BAYARD_REST_VERSION=$(cargo metadata --no-deps --format-version=1 | jq -r '.packages[] | select(.name=="bayard-rest") | .version')
BAYARD_REST_VERSIONS=$(curl -s -XGET https://crates.io/api/v1/crates/bayard-rest | jq -r '.versions[].num')
if echo ${BAYARD_REST_VERSIONS} | grep ${BAYARD_REST_VERSION} >/dev/null; then
echo "bayard-rest ${BAYARD_REST_VERSION} has already published"
else
pushd bayard-rest
cargo publish --token ${{ secrets.CRATES_TOKEN }}
popd
fi
sleep 20
BAYARD_VERSION=$(cargo metadata --no-deps --format-version=1 | jq -r '.packages[] | select(.name=="bayard") | .version')
BAYARD_VERSIONS=$(curl -s -XGET https://crates.io/api/v1/crates/bayard | jq -r '.versions[].num')
if echo ${BAYARD_VERSIONS} | grep ${BAYARD_VERSION} >/dev/null; then
Expand Down Expand Up @@ -215,10 +174,6 @@ jobs:
- run: |
BAYARD_VERSION=$(cargo metadata --no-deps --format-version=1 | jq -r '.packages[] | select(.name=="bayard") | .version')
echo "BAYARD_VERSION=${BAYARD_VERSION}" >> $GITHUB_ENV
BAYARD_REST_VERSION=$(cargo metadata --no-deps --format-version=1 | jq -r '.packages[] | select(.name=="bayard-rest") | .version')
echo "BAYARD_REST_VERSION=${BAYARD_REST_VERSION}" >> $GITHUB_ENV
BAYARD_CLI_VERSION=$(cargo metadata --no-deps --format-version=1 | jq -r '.packages[] | select(.name=="bayard-cli") | .version')
echo "BAYARD_CLI_VERSION=${BAYARD_CLI_VERSION}" >> $GITHUB_ENV
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
- uses: docker/login-action@v1
Expand All @@ -228,30 +183,10 @@ jobs:
- uses: docker/build-push-action@v2
with:
context: .
file: ./bayard.dockerfile
file: ./Dockerfile
push: true
build-args: |
BAYARD_VERSION=${{ env.BAYARD_VERSION }}
tags: |
bayardsearch/bayard:latest
bayardsearch/bayard:${{ env.BAYARD_VERSION }}
- uses: docker/build-push-action@v2
with:
context: .
file: ./bayard-rest.dockerfile
push: true
build-args: |
BAYARD_REST_VERSION=${{ env.BAYARD_REST_VERSION }}
tags: |
bayardsearch/bayard-rest:latest
bayardsearch/bayard-rest:${{ env.BAYARD_REST_VERSION }}
- uses: docker/build-push-action@v2
with:
context: .
file: ./bayard-cli.dockerfile
push: true
build-args: |
BAYARD_CLI_VERSION=${{ env.BAYARD_CLI_VERSION }}
tags: |
bayardsearch/bayard-cli:latest
bayardsearch/bayard-cli:${{ env.BAYARD_CLI_VERSION }}
mosuka/bayard:latest
mosuka/bayard:${{ env.BAYARD_VERSION }}
Loading

0 comments on commit 4a6c957

Please sign in to comment.