Skip to content

Commit 186106c

Browse files
committed
fix: fix
1 parent 60f2b3f commit 186106c

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

.github/workflows/docker.yml

+23-23
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,43 @@
1-
name: Docker
1+
name: Docker and Release
22
on:
33
push:
44
branches:
55
- lyra
66
tags:
77
- "v*"
8-
98
jobs:
109
build:
1110
continue-on-error: true
12-
1311
strategy:
1412
matrix:
1513
include:
1614
- release_for: Linux-x86_64
1715
build_on: ubuntu-latest
1816
target: x86_64-unknown-linux-gnu
1917
args: "--locked --release"
20-
2118
# - release_for: Linux-arm64
2219
# build_on: buildjet-2vcpu-ubuntu-2204-arm
2320
# target: "aarch64-unknown-linux-gnu"
2421
# args: "--locked --release"
25-
2622
runs-on: ${{ matrix.build_on }}
27-
2823
steps:
2924
- name: checkout repository
3025
uses: actions/checkout@v4
31-
3226
- uses: Swatinem/rust-cache@v2
3327
with:
3428
shared-key: "release"
35-
3629
- name: Install stable toolchain
3730
uses: actions-rs/toolchain@v1
3831
with:
3932
toolchain: stable
40-
4133
- name: Run cargo build
4234
uses: actions-rs/cargo@v1
4335
with:
4436
command: build
4537
args: --target ${{ matrix.target }} ${{ matrix.args }}
46-
4738
- name: rename binaries
4839
run: |
4940
mv target/${{ matrix.target }}/release/dolos${{ matrix.ext }} dolos-${{ matrix.release_for }}${{ matrix.ext }}
50-
5141
- name: upload artifacts
5242
uses: actions/upload-artifact@v4
5343
with:
@@ -57,21 +47,16 @@ jobs:
5747
docker:
5848
runs-on: ubuntu-latest
5949
needs: [build]
60-
6150
permissions:
6251
contents: read
6352
packages: write
64-
6553
env:
6654
IMAGE: us-central1-docker.pkg.dev/comet-7aaf0/comet-ar/dolos
67-
6855
steps:
6956
- name: Checkout repository
7057
uses: actions/checkout@v4
71-
7258
- name: Set up Docker Buildx
7359
uses: docker/setup-buildx-action@v3
74-
7560
- name: Extract metadata (tags, labels) for Docker
7661
id: meta
7762
uses: docker/metadata-action@v5
@@ -83,28 +68,21 @@ jobs:
8368
type=semver,pattern=v{{major}}.{{minor}}
8469
type=semver,pattern=v{{version}}
8570
type=sha
86-
8771
- name: Login to DockerHub
8872
uses: docker/login-action@v3
8973
with:
9074
registry: us-central1-docker.pkg.dev
9175
username: _json_key
9276
password: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
93-
9477
- name: Download artifacts
9578
uses: actions/download-artifact@v4
9679
with:
9780
pattern: binaries-*
9881
merge-multiple: true
9982
path: .github/image/bin
100-
101-
# we need to rename the artifact so that the name matches
102-
# the value that Docker uses for TARGET_ARCH to keep the
103-
# Dockerfile simple
10483
- name: Rename artifacts
10584
run: |+
10685
mv .github/image/bin/dolos-Linux-x86_64 .github/image/bin/dolos-Linux-amd64
107-
10886
- name: Build and push
10987
uses: docker/build-push-action@v5
11088
with:
@@ -113,3 +91,25 @@ jobs:
11391
push: true
11492
tags: ${{ steps.meta.outputs.tags }}
11593
labels: ${{ steps.meta.outputs.labels }}
94+
95+
release:
96+
needs: [build]
97+
if: startsWith(github.ref, 'refs/tags/v')
98+
runs-on: ubuntu-latest
99+
permissions:
100+
contents: write
101+
steps:
102+
- name: Download artifacts
103+
uses: actions/download-artifact@v4
104+
with:
105+
pattern: binaries-*
106+
merge-multiple: true
107+
path: release-binaries
108+
109+
- name: Create Release
110+
uses: softprops/action-gh-release@v1
111+
with:
112+
files: release-binaries/*
113+
draft: false
114+
prerelease: false
115+
generate_release_notes: true

0 commit comments

Comments
 (0)