Skip to content

Commit

Permalink
ci: update github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
fengyc committed Jun 11, 2023
1 parent 8340e91 commit 586cf6f
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: publish

on:
release:
types: [published]

jobs:
cargo-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cargo publish
env:
CARGO_TOKEN: ${{ secrets.CARGO_TOKEN }}
run: |
cargo publish --token "$CARGO_TOKEN"
71 changes: 71 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: release

on:
push:
tags:
- v*

jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
matrix:
target:
- arm-unknown-linux-musleabi
- arm-unknown-linux-musleabihf
- aarch64-unknown-linux-musl
- x86_64-unknown-linux-musl
steps:
- uses: actions/checkout@v2
- name: build
env:
TARGET: ${{ matrix.target }}
run: |
cargo install cross
cross build --release --target ${TARGET}
(cd target/${TARGET}/release && mv ads-proxy ads-proxy_${TARGET})
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.target }}
path: |
target/**/ads-proxy_*
build-windows:
runs-on: windows-latest
strategy:
matrix:
target:
- x86_64-pc-windows-msvc
- i686-pc-windows-msvc
steps:
- uses: actions/checkout@v2
- name: build
env:
TARGET: ${{ matrix.target }}
run: |
rustup target add $env:TARGET
cargo build --release --target $env:TARGET
cd target/$env:TARGET/release && mv ads-proxy.exe ads-proxy_$env:TARGET.exe
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.target }}
path: |
target/**/ads-proxy_*
release:
needs:
- build-linux
- build-windows
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v3
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
draft: true
files: |
**/ads-proxy_*
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
name = "ads-proxy"
version = "0.1.0"
edition = "2021"
authors = ["fengyingcai <fengyc.work@gmail.com>"]
description = "ADS proxy utility"
homepage = "https://github.com/fengyc/ads-proxy"
repository = "https://github.com/fengyc/ads-proxy"
readme = "README.md"
keywords = ["beckhoff", "ads", "proxy", "multiple connections"]
categories = ["network-programming"]
license = "MIT"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# ADS proxy

[![build-main](https://github.com/fengyc/ads-proxy/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/fengyc/ads-proxy/actions/workflows/main.yml)

This is a [Beckhoff ADS][ads] proxy that could resolve multiple connections with same ip address issues.

* ads issue: https://github.com/Beckhoff/ADS/issues/49
Expand Down

0 comments on commit 586cf6f

Please sign in to comment.