Skip to content

Commit

Permalink
Fix problems with latest release (#146)
Browse files Browse the repository at this point in the history
* Revise build-linux job to ensure all tar archives contain a coveralls binary. 
* Update README for new, dual architecture linux binaries.
* Fix syntax error per ameba linting.
* Force homebrew formula update to avoid issues with existing PRs.
  • Loading branch information
afinetooth authored Aug 23, 2024
1 parent bd61253 commit 41e9bd4
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 20 deletions.
52 changes: 42 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,12 @@ jobs:
--platform linux/amd64 \
--build-arg CRYSTAL_VERSION=1.13.1 \
--target x86_64_binary \
--output type=local,dest=./dist .
--output type=local,dest=./dist/x86_64 .
- name: (Debug) List contents of dist/x86_64
run: |
echo "Contents of dist/x86_64:"
ls -lah dist/x86_64/
- name: Build aarch64 binary
run: |
Expand All @@ -92,15 +97,41 @@ jobs:
--platform linux/arm64 \
--build-arg CRYSTAL_VERSION=1.13.1 \
--target aarch64_binary \
--output type=local,dest=./dist .
--output type=local,dest=./dist/aarch64 .
- name: Rename and prepare artifacts
- name: (Debug) List contents of dist/aarch64
run: |
cd dist
cp coveralls-linux-x86_64 coveralls-linux # Create the "generic" linux binary for backward compatibility
tar -czf coveralls-linux.tar.gz coveralls-linux
tar -czf coveralls-linux-x86_64.tar.gz coveralls-linux-x86_64
tar -czf coveralls-linux-aarch64.tar.gz coveralls-linux-aarch64
echo "Contents of dist/aarch64:"
ls -lah dist/aarch64/
- name: Prepare artifacts for x86_64
run: |
# Ensure the directory exists
if [ -d "dist/x86_64" ]; then
# Create tarball for x86_64
tar -czf dist/coveralls-linux-x86_64.tar.gz -C dist/x86_64 coveralls
# Create generic tarball for backward compatibility
tar -czf dist/coveralls-linux.tar.gz -C dist/x86_64 coveralls
# Create binaries for upload
cp dist/x86_64/coveralls dist/coveralls-linux
cp dist/x86_64/coveralls dist/coveralls-linux-x86_64
else
echo "dist/x86_64 directory does not exist!"
exit 1
fi
- name: Prepare artifacts for aarch64
run: |
# Ensure the directory exists
if [ -d "dist/aarch64" ]; then
# Create tarball for aarch64
tar -czf dist/coveralls-linux-aarch64.tar.gz -C dist/aarch64 coveralls
# Create binary for upload
cp dist/aarch64/coveralls dist/coveralls-linux-aarch64
else
echo "dist/aarch64 directory does not exist!"
exit 1
fi
- name: Upload generic linux binary (x86_64)
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -178,7 +209,7 @@ jobs:
mv coveralls.exe coveralls-windows.exe
sha256sum * > coveralls-checksums.txt
- name: (Debug) List Contents Release Directory
- name: (Debug) List Contents of Release Directory
run: |
echo "Listing contents of release/ directory:"
ls -lah release/
Expand All @@ -199,7 +230,7 @@ jobs:
'coveralls-linux-aarch64#coveralls-linux-aarch64'
'coveralls-linux-aarch64.tar.gz#coveralls-linux-aarch64.tar.gz'
'coveralls-windows.exe#coveralls-windows.exe'
'coveralls-windows.zip#coveralls-windows.zi'p
'coveralls-windows.zip#coveralls-windows.zip'
'coveralls-checksums.txt#coveralls-checksums.txt'
--generate-notes
Expand All @@ -215,3 +246,4 @@ jobs:
tap: coverallsapp/coveralls
formula: coveralls
token: ${{ secrets.HOMEBREW_TOKEN }}
force: true
12 changes: 4 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN sed -i '/ameba/d' shard.yml \
&& sed -i '/crystal-kcov/d' shard.yml \
&& shards install --ignore-crystal-version \
&& mkdir -p /app/bin \
&& crystal build --release src/coverage_reporter.cr -o /app/bin/coveralls-linux-x86_64
&& crystal build --release src/coverage_reporter.cr -o /app/bin/coveralls

# Stage 2: Build for aarch64
FROM 84codes/crystal:${CRYSTAL_VERSION}-${BASE_IMAGE_TAG} AS builder-aarch64
Expand All @@ -25,16 +25,12 @@ RUN sed -i '/ameba/d' shard.yml \
&& rm -rf .shards \
&& shards install --ignore-crystal-version \
&& mkdir -p /app/bin \
&& crystal build --release src/coverage_reporter.cr -o /app/bin/coveralls-linux-aarch64
&& crystal build --release src/coverage_reporter.cr -o /app/bin/coveralls

# Stage 3a: Export Binary for x86_64
FROM scratch AS x86_64_binary
COPY --from=builder-x86_64 /app/bin/coveralls-linux-x86_64 /
COPY --from=builder-x86_64 /app/bin/coveralls /coveralls

# Stage 3b: Export Binary for aarch64
FROM scratch AS aarch64_binary
COPY --from=builder-aarch64 /app/bin/coveralls-linux-aarch64 /

# Stage 4: Final stage to create a generic binary for backward compatibility
FROM scratch AS final
COPY --from=x86_64_binary /coveralls-linux-x86_64 /coveralls-linux
COPY --from=builder-aarch64 /app/bin/coveralls /coveralls
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,32 @@ Auto-detects your coverage artifact files and CI environment to post to [Coveral

### Linux

You can omit `-C /usr/local/bin` argument to keep it in current directory.
#### For x86_64 Architecture

You can choose to download and install from either the generic Linux archive or the `x86_64`-specific archive.

To install the generic Linux binary (which is for `x86_64`):

```bash
curl -L https://coveralls.io/coveralls-linux.tar.gz | tar -xz -C /usr/local/bin
```

To install the `x86_64`-specific binary:

```bash
curl -L https://coveralls.io/coveralls-linux-x86_64.tar.gz | tar -xz -C /usr/local/bin
```

#### For aarch64 Architecture

To install the `aarch64` binary:

```bash
curl -L https://coveralls.io/coveralls-linux-aarch64.tar.gz | tar -xz -C /usr/local/bin
```

**Note**: You can omit the `-C /usr/local/bin` argument to keep the binary in the current directory.

### MacOS

```bash
Expand Down
1 change: 0 additions & 1 deletion src/coverage_reporter.cr
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ require "./coverage_reporter/*"

module CoverageReporter
VERSION = "0.6.14"

end

0 comments on commit 41e9bd4

Please sign in to comment.