Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
cn-kali-team committed Sep 27, 2024
1 parent e960c87 commit a872c19
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/default-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# The way this works is the following:
#
# The create-release job runs purely to initialize the GitHub release itself
# and to output upload_url for the following job.
#
# The build-release job runs only once create-release is finished. It gets the
# release upload URL from create-release job outputs, then builds the release
# executables for each supported platform and attaches them as release assets
# to the previously created release.
#
# The key here is that we create the release only once.
#
# Reference:
# https://eugene-babichenko.github.io/blog/2020/05/09/github-actions-cross-platform-auto-releases/

name: default-release
on:
workflow_call:
workflow_dispatch:

jobs:
build-release:
name: build-release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Cache
uses: Swatinem/rust-cache@v1
- name: Install packages (Ubuntu)
run: |
sudo apt-get update
sudo apt-get install -y gcc-multilib xz-utils liblz4-tool libc6-dev libssl-dev musl-tools pkg-config patchelf
sudo apt-get install -y gcc-aarch64-linux-gnu gcc-arm-linux-gnueabihf
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
target: x86_64-unknown-linux-musl
- name: Build release binary
run: cargo install --git https://github.com/getzola/zola.git --features=indexing-zh
- name: Build archive
shell: bash
run: |
bin_file="~/.cargo/bin/zola"
echo "BIN_FILE=$bin_file" >> $GITHUB_ENV
- name: Upload binary to release
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.BIN_FILE }}
asset_name: zola
tag: default
overwrite: true

0 comments on commit a872c19

Please sign in to comment.