Skip to content

Commit

Permalink
refacctor nightly build
Browse files Browse the repository at this point in the history
  • Loading branch information
aeltorio committed Oct 18, 2024
1 parent 4a256f6 commit c503bf2
Show file tree
Hide file tree
Showing 5 changed files with 125 additions and 204 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/macos-intel-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,13 @@ jobs:
uses: actions/attest-build-provenance@v1
with:
subject-path: 'target/release/hbbs, target/release/hbbr, target/release/rustdesk-utils'

- name: Upload Release Assets binaries for Macos amd64
uses: softprops/action-gh-release@v2
continue-on-error: true
with:
files: |
/tmp/macos_${{ matrix.job.arch }}_${{ github.event.release.tag_name }}.zip

- name: Create Release with gh for Macos amd64
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
export TAG_NAME=${{ github.event.release.tag_name }}
export TAG_NAME=${TAG_NAME:-"nightly"}
echo $TAG_NAME
gh release create $TAG_NAME -t "$TAG_NAME" -n "$TAG_NAME" || true
gh release upload $TAG_NAME /tmp/macos_${{ matrix.job.arch }}_$TAG_NAME.zip --clobber
104 changes: 60 additions & 44 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,60 +12,76 @@ jobs:
contents: write
packages: write
attestations: write
env:
TARGET: x86_64-unknown-linux-musl

steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4

- name: Set up environment
run: |
sudo apt-get update
sudo apt-get install -y curl build-essential debhelper devscripts pkg-config libssl-dev libsqlite3-dev zip
- name: Set up environment
run: |
sudo apt-get update
sudo apt-get install -y curl build-essential debhelper devscripts pkg-config libssl-dev libsqlite3-dev zip musl-dev musl-tools
- name: Install Rust toolchain
uses: crusty-pie/toolchain@main
with:
- name: Install Rust toolchain
uses: crusty-pie/toolchain@main
with:
profile: minimal
toolchain: stable
override: true
targets: ${{env.TARGET}}

- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ubuntu-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ubuntu-cargo-git-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: ~/.cargo/registry
key: ubuntu-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v4
with:
path: ~/.cargo/git
key: ubuntu-cargo-git-${{ hashFiles('**/Cargo.lock') }}

- name: Cache cargo build
uses: actions/cache@v4
with:
path: target
key: ubuntu-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v4
with:
path: target
key: ubuntu-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Build project
run: |
cargo update -p sctgdesk-api-server
DATABASE_URL=sqlite://$(pwd)/db_v2.sqlite3 cargo build --release
- name: Build project
run: |
cargo update -p sctgdesk-api-server
DATABASE_URL=sqlite://$(pwd)/db_v2.sqlite3 cargo build --target=${{env.TARGET}} --release
zip -r /tmp/linux_${{env.TARGET}}.zip target/${{env.TARGET}}/release/hbbs target/${{env.TARGET}}/release/hbbr target/${{env.TARGET}}/release/rustdesk-utils
- name: Attest release
uses: actions/attest-build-provenance@v1
with:
subject-path: 'target/release/hbbs, target/release/hbbr, target/release/rustdesk-utils'
- name: Attest release
uses: actions/attest-build-provenance@v1
with:
subject-path: "target/${{env.TARGET}}/release/hbbs, target/${{env.TARGET}}/release/hbbr, target/${{env.TARGET}}/release/rustdesk-utils"

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ubuntu_amd64
path: |
target/release/hbbs
target/release/hbbr
target/release/rustdesk-utils
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ubuntu_amd64
path: |
target/${{env.TARGET}}release/hbbs
target/${{env.TARGET}}release/hbbr
target/${{env.TARGET}}release/rustdesk-utils
/tmp/linux_${{env.TARGET}}.zip
- name: Create Release with gh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
export TAG_NAME=${{ github.event.release.tag_name }}
export TAG_NAME=${TAG_NAME:-"nightly"}
echo $TAG_NAME
mv /tmp/linux_${{env.TARGET}}.zip /tmp/linux_${{env.TARGET}}_${TAG_NAME}.zip
gh release create $TAG_NAME -t "$TAG_NAME" -n "$TAG_NAME" || true
gh release upload $TAG_NAME /tmp/linux_${{env.TARGET}}_${TAG_NAME}.zip --clobber
15 changes: 8 additions & 7 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,15 @@ jobs:
with:
subject-path: '/tmp/windows_${{ matrix.job.arch }}_${{ github.event.release.tag_name }}.zip'

- name: Upload Release Assets binaries for Windows
uses: softprops/action-gh-release@v2
continue-on-error: true
with:
files: |
/tmp/windows_${{ matrix.job.arch }}_${{ github.event.release.tag_name }}.zip
- name: Create Release with gh for Windows amd64
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
export TAG_NAME=${{ github.event.release.tag_name }}
export TAG_NAME=${TAG_NAME:-"nightly"}
echo $TAG_NAME
gh release create $TAG_NAME -t "$TAG_NAME" -n "$TAG_NAME" || true
gh release upload $TAG_NAME /tmp/windows_${{ matrix.job.arch }}_$TAG_NAME.zip --clobber
- name: Attest release
uses: actions/attest-build-provenance@v1
Expand Down
Loading

0 comments on commit c503bf2

Please sign in to comment.