Compare commits
3 commits
8adccbbe71
...
8a1768631d
Author | SHA1 | Date | |
---|---|---|---|
8a1768631d | |||
0d2469ac5d | |||
a275093b14 |
3 changed files with 30 additions and 17 deletions
|
@ -16,25 +16,29 @@ jobs:
|
||||||
- x86_64-unknown-linux-musl
|
- x86_64-unknown-linux-musl
|
||||||
- aarch64-unknown-linux-gnu
|
- aarch64-unknown-linux-gnu
|
||||||
- aarch64-unknown-linux-musl
|
- aarch64-unknown-linux-musl
|
||||||
|
- x86_64-pc-windows-gnu
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ref: master
|
ref: master
|
||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
- uses: https://codeberg.org/TheAwiteb/rust-action@v1.78
|
- uses: https://codeberg.org/TheAwiteb/rust-action@v1.74
|
||||||
- name: Install musl-tools
|
- name: Install musl-tools
|
||||||
if: contains(${{ matrix.target }}, 'musl')
|
|
||||||
run: |
|
run: |
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y musl-tools
|
apt-get install -y musl-tools
|
||||||
|
if: ${{ contains(matrix.target, 'musl') }}
|
||||||
- name: Install gcc-aarch64-linux-gnu linker
|
- name: Install gcc-aarch64-linux-gnu linker
|
||||||
if: contains(${{ matrix.target }}, 'aarch64')
|
|
||||||
run: |
|
run: |
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y gcc-aarch64-linux-gnu
|
apt-get install -y gcc-aarch64-linux-gnu
|
||||||
- name: Install ${{ matrix.target }} target
|
if: ${{ contains(matrix.target, 'aarch64') }}
|
||||||
run: rustup target install ${{ matrix.target }}
|
- name: Install gcc-mingw-w64 linker
|
||||||
- name: Setup environment
|
run: |
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y gcc-mingw-w64
|
||||||
|
if: ${{ contains(matrix.target, 'windows') }}
|
||||||
|
- name: Preparing the environment
|
||||||
run: |
|
run: |
|
||||||
BIN_NAME="$(echo $GITHUB_REPOSITORY | cut -d '/' -f 2)"
|
BIN_NAME="$(echo $GITHUB_REPOSITORY | cut -d '/' -f 2)"
|
||||||
echo "BIN_NAME=$BIN_NAME" >> $GITHUB_ENV
|
echo "BIN_NAME=$BIN_NAME" >> $GITHUB_ENV
|
||||||
|
@ -43,23 +47,29 @@ jobs:
|
||||||
echo 'target.aarch64-unknown-linux-gnu.linker = "aarch64-linux-gnu-gcc"' > .cargo/config.toml
|
echo 'target.aarch64-unknown-linux-gnu.linker = "aarch64-linux-gnu-gcc"' > .cargo/config.toml
|
||||||
echo 'target.aarch64-unknown-linux-musl.linker = "aarch64-linux-gnu-gcc"' >> .cargo/config.toml
|
echo 'target.aarch64-unknown-linux-musl.linker = "aarch64-linux-gnu-gcc"' >> .cargo/config.toml
|
||||||
|
|
||||||
- name: Build ${{ matrix.target }} asset
|
- name: Install the target
|
||||||
|
run: rustup target install ${{ matrix.target }}
|
||||||
|
|
||||||
|
- name: Build the asset
|
||||||
run: |
|
run: |
|
||||||
APP_NAME="$BIN_NAME-$GITHUB_REF_NAME-${{ matrix.target }}"
|
APP_NAME="$BIN_NAME-$GITHUB_REF_NAME-${{ matrix.target }}"
|
||||||
cargo clean
|
cargo clean
|
||||||
cargo build --release --no-default-features --target ${{ matrix.target }}
|
cargo build --release --no-default-features --target ${{ matrix.target }}
|
||||||
cp target/${{ matrix.target }}/release/$BIN_NAME release-dir/$APP_NAME
|
cp target/${{ matrix.target }}/release/$BIN_NAME.exe release-dir/$APP_NAME.exe || true
|
||||||
|
cp target/${{ matrix.target }}/release/$BIN_NAME release-dir/$APP_NAME || true
|
||||||
cd release-dir
|
cd release-dir
|
||||||
chmod +x $APP_NAME
|
sha256sum $APP_NAME > $APP_NAME.sha256 || true
|
||||||
sha256sum $APP_NAME > $APP_NAME.sha256
|
sha256sum $APP_NAME.exe > $APP_NAME.exe.sha256 || true
|
||||||
- name: Build ${{ matrix.target }} asset (update-notify)
|
|
||||||
|
- name: Build the asset (update-notify)
|
||||||
run: |
|
run: |
|
||||||
APP_NAME="$BIN_NAME-update-notify-$GITHUB_REF_NAME-${{ matrix.target }}"
|
APP_NAME="$BIN_NAME-update-notify-$GITHUB_REF_NAME-${{ matrix.target }}"
|
||||||
cargo build --release -F update-notify --target ${{ matrix.target }}
|
cargo build --release -F update-notify --target ${{ matrix.target }}
|
||||||
cp ./target/${{ matrix.target }}/release/$BIN_NAME release-dir/$APP_NAME
|
cp target/${{ matrix.target }}/release/$BIN_NAME.exe release-dir/$APP_NAME.exe || true
|
||||||
|
cp target/${{ matrix.target }}/release/$BIN_NAME release-dir/$APP_NAME || true
|
||||||
cd release-dir
|
cd release-dir
|
||||||
chmod +x $APP_NAME
|
sha256sum $APP_NAME > $APP_NAME.sha256 || true
|
||||||
sha256sum $APP_NAME > $APP_NAME.sha256
|
sha256sum $APP_NAME.exe > $APP_NAME.exe.sha256 || true
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
@ -81,7 +91,7 @@ jobs:
|
||||||
path: ${{ env.GITHUB_WORKSPACE }}/release-dir
|
path: ${{ env.GITHUB_WORKSPACE }}/release-dir
|
||||||
- name: Install git-cliff
|
- name: Install git-cliff
|
||||||
run: |
|
run: |
|
||||||
version="2.1.2"
|
version="2.2.1"
|
||||||
wget "https://github.com/orhun/git-cliff/releases/download/v$version/git-cliff-$version-x86_64-unknown-linux-gnu.tar.gz"
|
wget "https://github.com/orhun/git-cliff/releases/download/v$version/git-cliff-$version-x86_64-unknown-linux-gnu.tar.gz"
|
||||||
tar -xvzf git-cliff-*.tar.gz
|
tar -xvzf git-cliff-*.tar.gz
|
||||||
mv "git-cliff-$version/git-cliff" /usr/local/bin
|
mv "git-cliff-$version/git-cliff" /usr/local/bin
|
||||||
|
|
|
@ -20,7 +20,7 @@ jobs:
|
||||||
wget "https://github.com/orhun/git-cliff/releases/download/v$version/git-cliff-$version-x86_64-unknown-linux-gnu.tar.gz"
|
wget "https://github.com/orhun/git-cliff/releases/download/v$version/git-cliff-$version-x86_64-unknown-linux-gnu.tar.gz"
|
||||||
tar -xvzf git-cliff-*.tar.gz
|
tar -xvzf git-cliff-*.tar.gz
|
||||||
mv "git-cliff-$version/git-cliff" /usr/local/bin
|
mv "git-cliff-$version/git-cliff" /usr/local/bin
|
||||||
rm -fr git-cliff-*
|
rm -fr git-cliff-*
|
||||||
- name: Write changelog
|
- name: Write changelog
|
||||||
run: |
|
run: |
|
||||||
git config user.name forgejo-actions
|
git config user.name forgejo-actions
|
||||||
|
|
|
@ -45,7 +45,10 @@ cargo build --release
|
||||||
This will build Lprs with update checking enabled. If you want to disable update checking, you can build Lprs without the default features by passing the `--no-default-features` flag.
|
This will build Lprs with update checking enabled. If you want to disable update checking, you can build Lprs without the default features by passing the `--no-default-features` flag.
|
||||||
|
|
||||||
### Pre-built binaries
|
### Pre-built binaries
|
||||||
Pre-built binaries are available for Linux only, you can download them from the [releases page](https://git.4rs.nl/awiteb/lprs/releases/latest).
|
Pre-built binaries are available for Linux and Windows on the [releases
|
||||||
|
page](https://git.4rs.nl/awiteb/lprs/releases/latest). There is tow version of
|
||||||
|
the binary, one with update checking enabled and other not, the binaries with
|
||||||
|
update checking enabled have the `lrps-update-notify` prefix.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue