navi/.github/workflows/cd.yml
Alexis Opolka 138b7e0b00
Update the Continuous Deployment pipeline with a minimal amount of dependencies (#971)
* Merged dotfiles/scripts into navi/scripts

Signed-off-by: alexis-opolka <53085471+alexis-opolka@users.noreply.github.com>

* Fixes the permission denied issue

Signed-off-by: alexis-opolka <53085471+alexis-opolka@users.noreply.github.com>

* Update log functions

Signed-off-by: alexis-opolka <53085471+alexis-opolka@users.noreply.github.com>

* Test new workflow

Signed-off-by: alexis-opolka <53085471+alexis-opolka@users.noreply.github.com>

* Update cd.yml

* Update release script

Signed-off-by: alexis-opolka <53085471+alexis-opolka@users.noreply.github.com>

* Fix attempt

Signed-off-by: alexis-opolka <53085471+alexis-opolka@users.noreply.github.com>

* Update the set-ouput method

Signed-off-by: alexis-opolka <53085471+alexis-opolka@users.noreply.github.com>

* Added debugging log::info

Signed-off-by: alexis-opolka <53085471+alexis-opolka@users.noreply.github.com>

* Tries to fixe issues

Signed-off-by: alexis-opolka <53085471+alexis-opolka@users.noreply.github.com>

* Tries to fixe issues

Signed-off-by: alexis-opolka <53085471+alexis-opolka@users.noreply.github.com>

* Tries to fixe issues

Signed-off-by: alexis-opolka <53085471+alexis-opolka@users.noreply.github.com>

* Tries to fixe issues

Signed-off-by: alexis-opolka <53085471+alexis-opolka@users.noreply.github.com>

* Tries to fixe issues

Signed-off-by: alexis-opolka <53085471+alexis-opolka@users.noreply.github.com>

* Tries to fixe issues

Signed-off-by: alexis-opolka <53085471+alexis-opolka@users.noreply.github.com>

* Tries to fixe issues

Signed-off-by: alexis-opolka <53085471+alexis-opolka@users.noreply.github.com>

* Tries to fixe issues

Signed-off-by: alexis-opolka <53085471+alexis-opolka@users.noreply.github.com>

* Tries to fixe issues

Signed-off-by: alexis-opolka <53085471+alexis-opolka@users.noreply.github.com>

* Tries to fixe issues

Signed-off-by: alexis-opolka <53085471+alexis-opolka@users.noreply.github.com>

* Tries to fixe issues

Signed-off-by: alexis-opolka <53085471+alexis-opolka@users.noreply.github.com>

* Tries to fixe issues

Signed-off-by: alexis-opolka <53085471+alexis-opolka@users.noreply.github.com>

* Tries to fixe issues

Signed-off-by: alexis-opolka <53085471+alexis-opolka@users.noreply.github.com>

* Removed debugging log::info

Signed-off-by: alexis-opolka <53085471+alexis-opolka@users.noreply.github.com>

* Adds more comments on what the expressions does

Signed-off-by: alexis-opolka <53085471+alexis-opolka@users.noreply.github.com>

* Add once again the use of UPX for the linux releases

Signed-off-by: alexis-opolka <53085471+alexis-opolka@users.noreply.github.com>

* Tries to fix issues

Signed-off-by: alexis-opolka <53085471+alexis-opolka@users.noreply.github.com>

* Comment UPX until I found how it was used and implemented it correctly

Signed-off-by: alexis-opolka <53085471+alexis-opolka@users.noreply.github.com>

---------

Signed-off-by: alexis-opolka <53085471+alexis-opolka@users.noreply.github.com>
2025-04-09 20:16:14 +02:00

72 lines
2.4 KiB
YAML

name: Publish
on:
push:
tags:
- "*"
release:
jobs:
binary:
name: Publish ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
target: x86_64-apple-darwin
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
- os: ubuntu-latest
target: x86_64-pc-windows-gnu
- os: ubuntu-latest
target: armv7-unknown-linux-musleabihf
- os: ubuntu-latest
target: armv7-linux-androideabi
- os: ubuntu-latest
target: aarch64-linux-android
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
- os: macos-latest
target: aarch64-apple-darwin
steps:
### We're checking out the repository at the triggered ref
- uses: actions/checkout@v4
- name: Get the version
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Check if release exists
id: check_release
run: |
if gh release view ${{ steps.get_version.outputs.VERSION }} > /dev/null 2>&1; then
echo "RELEASE_EXISTS=true" >> $GITHUB_OUTPUT
else
echo "RELEASE_EXISTS=false" >> $GITHUB_OUTPUT
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create release
continue-on-error: true
if: steps.check_release.outputs.RELEASE_EXISTS == 'false'
run: |
gh release create ${{ steps.get_version.outputs.VERSION }} \
--title "Release ${{ steps.get_version.outputs.VERSION }}" \
--notes "Release notes for ${{ steps.get_version.outputs.VERSION }}" \
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build
id: build
run: scripts/release ${{ matrix.target }}
- name: Upload binaries to release
run: |
cd ./target/${{ matrix.target }}/release/
cp navi.${{ steps.build.outputs.EXTENSION }} navi-${{ steps.get_version.outputs.VERSION }}-${{ matrix.target }}.${{ steps.build.outputs.EXTENSION }}
gh release upload ${{ steps.get_version.outputs.VERSION }} navi-${{ steps.get_version.outputs.VERSION }}-${{ matrix.target }}.${{ steps.build.outputs.EXTENSION }}
env:
GH_TOKEN: ${{ github.token }}