Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
ci: fix dockerfile entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
scarmuega committed Dec 24, 2023
1 parent c162f41 commit f44be0d
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 17 deletions.
7 changes: 5 additions & 2 deletions .github/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
FROM alpine:latest
FROM debian:12-slim

RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*

ARG TARGETARCH
COPY dmtrd-${TARGETARCH} /bin/dmtrd
COPY binaries/Linux-GNU-${TARGETARCH}-dmtrd /bin/dmtrd
RUN chmod +x /bin/dmtrd
RUN ln -s /bin/dmtrd /dmtrd

ENTRYPOINT ["dmtrd"]
69 changes: 54 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Release

on:
push:
tags: v*
tags:
- "v*"

jobs:
build:
Expand All @@ -11,46 +11,53 @@ jobs:
strategy:
matrix:
include:
- release_for: Linux-GNU-x86_64
- release_for: Linux-GNU-amd64
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
arch: amd64
args: "--locked --release"
bin: dmtrd

- release_for: Linux-GNU-armv7
- release_for: Linux-GNU-arm64
os: ubuntu-latest
target: "aarch64-unknown-linux-gnu"
arch: arm64
args: "--locked --release"
bin: dmtrd

runs-on: ${{ matrix.os }}

steps:
- name: Checkout repository
uses: actions/checkout@v2

- uses: Swatinem/rust-cache@v2

- name: Checkout
- name: checkout repository
uses: actions/checkout@v3

- name: Build binary
- uses: Swatinem/rust-cache@v2

- name: build binary
uses: houseabsolute/actions-rust-cross@v0
with:
command: both
command: build
target: ${{ matrix.target }}
args: ${{ matrix.args }}
strip: true

- name: rename binaries
run: |
mv target/${{ matrix.target }}/release/${{ matrix.bin }} ${{ matrix.release_for }}-${{ matrix.bin }}
- name: upload artifacts
uses: actions/upload-artifact@v3
with:
name: dmtrd-${{ matrix.arch }}
path: target/${{ matrix.target }}/release/dmtrd
name: binaries
path: ${{ matrix.release_for }}-${{ matrix.bin }}

docker:
runs-on: ubuntu-latest
needs: [build]

permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v2
Expand Down Expand Up @@ -88,3 +95,35 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

release:
needs: [build, docker]

runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: setup go
uses: actions/setup-go@v4
with:
go-version: "1.16"

- name: download artifacts
id: "download"
uses: actions/download-artifact@v3

- name: set release notes
run: |
go install github.com/git-chglog/git-chglog/cmd/[email protected]
git-chglog -c .github/chglog/release.yml $(git describe --tags) > RELEASE.md
- name: create release
uses: softprops/action-gh-release@v1
with:
files: binaries/*
body_path: RELEASE.md
draft: true

0 comments on commit f44be0d

Please sign in to comment.