Skip to content

Commit

Permalink
CI: Merge release into build.
Browse files Browse the repository at this point in the history
  • Loading branch information
heiher committed May 12, 2024
1 parent 839c3c9 commit b07ddc9
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 85 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,39 @@ name: "Build"

on:
push:
branches:
- '**'
pull_request:
release:
types:
- published

jobs:
source:
name: Source
runs-on: ubuntu-20.04
if: github.event_name == 'release'
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
submodules: true
- name: Gen Source
run: |
mkdir -p hev-socks5-tproxy-${{ github.ref_name }}
git ls-files --recurse-submodules | tar c -O -T- | tar x -C hev-socks5-tproxy-${{ github.ref_name }}
tar caf hev-socks5-tproxy-${{ github.ref_name }}.tar.gz hev-socks5-tproxy-${{ github.ref_name }}
- name: Upload source
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: hev-socks5-tproxy-${{ github.ref_name }}.tar.gz
asset_name: hev-socks5-tproxy-${{ github.ref_name }}.tar.gz
asset_content_type: application/octet-stream

build:
name: Build
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -49,3 +79,13 @@ jobs:
wget https://github.com/musl-cross/musl-cross/releases/download/20240317/${{ matrix.tool }}.tgz
sudo tar xf ${{ matrix.tool }}.tgz -C /opt/x-tools
make CROSS_PREFIX=/opt/x-tools/${{ matrix.tool }}/bin/${{ matrix.tool }}- CFLAGS=${{ matrix.env.CFLAGS }} ENABLE_STATIC=1 -j`nproc`
- name: Upload ${{ matrix.name }}
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: bin/hev-socks5-tproxy
asset_name: hev-socks5-tproxy-linux-${{ matrix.name }}
asset_content_type: application/octet-stream
85 changes: 0 additions & 85 deletions .github/workflows/release.yaml

This file was deleted.

0 comments on commit b07ddc9

Please sign in to comment.