Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scx1332/trying to run2 #31

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,90 @@ jobs:
asset_path: ${{ steps.deb.outputs.path }}
asset_name: ${{ steps.deb.outputs.name }}
asset_content_type: application/vnd.debian.binary-package
build-arm:
name: Build ARM Release
needs:
- create-release
runs-on: ubuntu-latest
env:
OPENSSL_STATIC: 1
steps:
- name: Checkout
uses: actions/checkout@v1
with:
lfs: true

- name: Get upload url
id: release_upload_url
uses: actions/github-script@0.9.0
with:
github-token: ${{secrets.GITHUB_TOKEN}}
result-encoding: string
script: |
let tag = context.payload.ref.replace(/.*\//, '');
let release = await github.request("GET /repos/:owner/:repo/releases/tags/:tag", {
owner: context.repo.owner,
repo: context.repo.repo,
tag: tag
});
console.log(release.data.upload_url);
return release.data.upload_url

- name: Install last stable Rust cross compiler
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: aarch64-unknown-linux-musl
override: true

- name: Build proxy
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: -p ya-http-proxy --bin ya-http-proxy --features bin --release --target aarch64-unknown-linux-musl

- name: Build runtime
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target aarch64-unknown-linux-musl

- name: Pack
id: pack
shell: bash
env:
GITHUB_REF: ${{ github.ref }}
OS_NAME: linux
run: |
TAG_NAME="${GITHUB_REF##*/}"
TARGET_DIR=releases/ya-runtime-http-auth-arm-${TAG_NAME}

ls -la target
mkdir -p "$TARGET_DIR/ya-runtime-http-auth"
#strip "target/aarch64-unknown-linux-musl/release/ya-runtime-http-auth"
#strip "target/aarch64-unknown-linux-musl/release/ya-http-proxy"

set -x
cp target/aarch64-unknown-linux-musl/release/ya-runtime-http-auth "$TARGET_DIR/ya-runtime-http-auth/"
cp target/aarch64-unknown-linux-musl/release/ya-http-proxy "$TARGET_DIR/ya-runtime-http-auth/"
cp conf/ya-runtime-http-auth.json "$TARGET_DIR/"
(cd releases && tar czvf "ya-runtime-http-auth-arm-${TAG_NAME}.tar.gz" "ya-runtime-http-auth-arm-${TAG_NAME}")

echo "::set-output name=artifact::ya-runtime-http-auth-arm-${TAG_NAME}.tar.gz"
echo "::set-output name=media::application/tar+gzip"

- name: Upload
run: echo todo upload ${{ steps.pack.outputs.artifact }}

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release_upload_url.outputs.result }}
asset_path: ./releases/${{ steps.pack.outputs.artifact }}
asset_name: ${{ steps.pack.outputs.artifact }}
asset_content_type: ${{ steps.pack.outputs.media }}
79 changes: 79 additions & 0 deletions .github/workflows/rust_arm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Build for ARM

on:
push:
branches:
- main
- release/*
- scx1332/*
pull_request:
branches:
- main
- release/*


jobs:
build_arm:
name: Build Arm
env:
RUSTFLAGS: "-D warnings -C opt-level=z -C debuginfo=1"
X86_64_PC_WINDOWS_MSVC_OPENSSL_DIR: c:/vcpkg/installed/x64-windows
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]

steps:
- name: Checkout
uses: actions/checkout@v1

- name: Install last stable Rust cross compiler
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: aarch64-unknown-linux-musl
override: true

- name: Build proxy
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: -p ya-http-proxy --bin ya-http-proxy --features bin --release --target aarch64-unknown-linux-musl

- name: Build runtime
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target aarch64-unknown-linux-musl

- name: Pack
id: pack
shell: bash
env:
GITHUB_REF: ${{ github.ref }}
OS_NAME: linux
run: |
TAG_NAME="${GITHUB_REF##*/}"
TARGET_DIR=releases/ya-runtime-http-auth-linux-${TAG_NAME}

ls -la target
mkdir -p "$TARGET_DIR/ya-runtime-http-auth"
#strip "target/aarch64-unknown-linux-musl/release/ya-runtime-http-auth"
#strip "target/aarch64-unknown-linux-musl/release/ya-http-proxy"

set -x
cp target/aarch64-unknown-linux-musl/release/ya-runtime-http-auth "$TARGET_DIR/ya-runtime-http-auth/"
cp target/aarch64-unknown-linux-musl/release/ya-http-proxy "$TARGET_DIR/ya-runtime-http-auth/"
cp conf/ya-runtime-http-auth.json "$TARGET_DIR/"
(cd releases && tar czvf "ya-runtime-http-auth-${OS_NAME}-${TAG_NAME}.tar.gz" "ya-runtime-http-auth-${OS_NAME}-${TAG_NAME}")

echo "::set-output name=artifact::ya-runtime-http-auth-${OS_NAME}-${TAG_NAME}.tar.gz"
echo "::set-output name=media::application/tar+gzip"

- name: Upload
uses: actions/upload-artifact@v3
with:
name: ya-runtime-http-auth
path: ./releases/${{ steps.pack.outputs.artifact }}
133 changes: 105 additions & 28 deletions Cargo.lock

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

Loading