This repository has been archived by the owner on Sep 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
59 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: v* | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
build: | ||
|
@@ -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 | ||
|
@@ -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 |