Skip to content

Commit

Permalink
ci: update release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
cilki committed Jun 29, 2024
1 parent f235646 commit f0ec693
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 72 deletions.
52 changes: 1 addition & 51 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,48 +24,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

linux:
name: linux / ${{ matrix.target }}
runs-on: ubuntu-latest
needs: github
strategy:
fail-fast: false
matrix:
target:
- aarch64-unknown-linux-gnu
- aarch64-unknown-linux-musl
- i686-unknown-linux-gnu
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
steps:
- uses: actions/checkout@v4
with:
fetch-tags: true

- uses: actions-rs/cargo@v1
with:
command: build
args: --release --target ${{ matrix.target }}

- uses: actions/upload-artifact@v4
with:
name: turbine-${{ matrix.target }}
path: target/${{ matrix.target }}/release/turbine

- name: Upload artifacts to release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
run: |
for tag in $(git tag --points-at HEAD); do
if cp target/${{ matrix.target }}/release/turbine turbine_${{ matrix.target }}; then
gh release upload "${tag##*-}" "turbine_${{ matrix.target }}"
fi
done
docker:
runs-on: ubuntu-latest
needs: linux
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -75,16 +35,6 @@ jobs:

- uses: docker/setup-buildx-action@v3

- uses: actions/download-artifact@v4
with:
name: turbine-x86_64-unknown-linux-musl
path: turbine/linux-amd64

- uses: actions/download-artifact@v4
with:
name: turbine-aarch64-unknown-linux-musl
path: turbine/linux-arm64

- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
Expand All @@ -101,7 +51,7 @@ jobs:
if: ${{ steps.get_tags.outputs.turbine != '' }}
with:
context: .
platforms: linux/amd64 #,linux/arm64,linux/arm/v7
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: fossable/turbine:latest,fossable/turbine:${{ steps.get_tags.outputs.turbine }}

Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 7 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
FROM rust as builder
FROM rust as build

RUN USER=root cargo new --bin turbine
WORKDIR /turbine
COPY ./Cargo.toml ./Cargo.toml
RUN cargo build --release
RUN rm src/*.rs

ADD src ./src
ADD templates ./templates
ADD assets ./assets

RUN rm ./target/release/deps/turbine*
WORKDIR /build
COPY . .
RUN cargo build --release --all-features

FROM debian:bookworm-slim
ARG APP=/app
EXPOSE 80
ENV TZ=Etc/UTC
EXPOSE 80
ARG BUILDARCH

RUN apt-get update \
&& apt-get install -y bzip2 ca-certificates curl tzdata git gpg \
Expand All @@ -26,7 +17,6 @@ RUN apt-get update \
RUN curl https://downloads.getmonero.org/cli/monero-linux-x64-v0.18.3.3.tar.bz2 | tar --transform='flags=r;s|.*/||' -xjf - -C /usr/bin monero-x86_64-linux-gnu-v0.18.3.3/monero-wallet-rpc

# Install turbine
COPY --from=builder /turbine/target/release/turbine ${APP}/turbine
COPY --from=build /build/target/release/turbine /usr/bin/turbine

WORKDIR ${APP}
ENTRYPOINT ["/app/turbine", "serve"]
ENTRYPOINT ["/usr/bin/turbine", "serve"]

0 comments on commit f0ec693

Please sign in to comment.