diff --git a/.github/workflows/Deploy.yaml b/.github/workflows/Deploy.yaml index 3a0e194..c67c3b9 100644 --- a/.github/workflows/Deploy.yaml +++ b/.github/workflows/Deploy.yaml @@ -1,4 +1,4 @@ -name: Create Release +name: Create Github Release on: push: diff --git a/.github/workflows/Release.yaml b/.github/workflows/Release.yaml index 4519a4f..b820435 100644 --- a/.github/workflows/Release.yaml +++ b/.github/workflows/Release.yaml @@ -1,4 +1,4 @@ -name: Release +name: Autobump on: workflow_dispatch: diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 25d8a33..cc12e54 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -6,7 +6,23 @@ on: jobs: test: - runs-on: ubuntu-latest + strategy: + matrix: + include: + - os: macos-latest + target: x86_64-apple-darwin + - os: macos-latest + target: aarch64-apple-darwin + - os: ubuntu-latest + target: x86_64-unknown-linux-musl + - os: windows-latest + target: x86_64-pc-windows-msvc + - os: ubuntu-latest + target: armv7-unknown-linux-musleabihf + - os: ubuntu-latest + target: aarch64-unknown-linux-gnu + + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -35,6 +51,16 @@ jobs: - run: echo "${{ steps.cog-changelog.outputs.stdout }}" + - uses: ./cocogitto-action + id: invalid-step + with: + command: invalid + continue-on-error: true + + - name: Assert action errored + if: steps.invalid-step.outcome == 'failure' + run: echo "Action errored as expected" + test-container: runs-on: ubuntu-latest container: @@ -65,3 +91,13 @@ jobs: command: changelog - run: echo "${{ steps.cog-changelog.outputs.stdout }}" + + - uses: ./cocogitto-action + id: invalid-step + with: + command: invalid + continue-on-error: true + + - name: Assert action errored + if: steps.invalid-step.outcome == 'failure' + run: echo "Action errored as expected" diff --git a/cog.sh b/cog.sh index 504ad4e..9ef732c 100755 --- a/cog.sh +++ b/cog.sh @@ -22,6 +22,9 @@ fi echo "Running command: cog $COMMAND $ARGS" stdout="$(cog $COMMAND $ARGS 2>&1)" +if [ $? -ne 0 ]; then + exit 1 +fi echo $stdout echo "stdout<> "$GITHUB_OUTPUT" echo "$stdout" >> "$GITHUB_OUTPUT" diff --git a/install.sh b/install.sh index f0ce61f..518b9ce 100755 --- a/install.sh +++ b/install.sh @@ -1,8 +1,7 @@ - #!/bin/sh CUR_DIR=$(pwd) -VERSION=6.3.0 +VERSION=6.4.0 BIN_DIR="$HOME/.local/bin" PLATFORM=$(uname -s | tr '[:upper:]' '[:lower:]') @@ -12,7 +11,7 @@ case $PLATFORM in linux|darwin|mingw*) case $ARCH in x86_64|amd64) ARCH="x86_64" ;; - aarch64) ARCH="aarch64" ;; + aarch64|arm64) ARCH="aarch64" ;; armv7l) ARCH="armv7" ;; *) echo "Unsupported architecture: $ARCH"; exit 1 ;; esac @@ -35,9 +34,14 @@ case $PLATFORM in esac TAR="cocogitto-$VERSION-$ARCH-$PLATFORM.tar.gz" +echo "Downloading cocogitto version $VERSION for $ARCH-$PLATFORM from https://github.com/cocogitto/cocogitto/releases/download/$VERSION/$TAR" mkdir -p "$BIN_DIR" cd "$BIN_DIR" || exit curl -OL https://github.com/cocogitto/cocogitto/releases/download/"$VERSION"/"$TAR" -tar --strip-components=1 -xzf $TAR "$ARCH-$PLATFORM/cog" +if [ "$PLATFORM" = "pc-windows-msvc" ]; then + tar --strip-components=1 -xzf $TAR "$ARCH-$PLATFORM/cog.exe" +else + tar --strip-components=1 -xzf $TAR "$ARCH-$PLATFORM/cog" +fi cd "$CUR_DIR" || exit