Skip to content

Commit

Permalink
Write tool versions to release note (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
at-wat authored Mar 28, 2023
1 parent 7f82386 commit 4ee7fd4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
22 changes: 17 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ on:
push:
branches:
- master
tags:
- '*'
release:
types: [published]

jobs:
build-image:
permissions:
contents: read
contents: write
packages: write
runs-on: ubuntu-latest
steps:
Expand All @@ -27,13 +27,25 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy devel
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
if: github.event_name == 'push'
run: |
docker tag ghcr.io/seqsense/protoc-assets ghcr.io/seqsense/protoc-assets:devel
docker push ghcr.io/seqsense/protoc-assets:devel
- name: Deploy release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
if: github.event_name == 'release'
run: |
IMAGE_TAG=${GITHUB_REF#refs/tags/}
docker tag ghcr.io/seqsense/protoc-assets ghcr.io/seqsense/protoc-assets:${IMAGE_TAG}
docker push ghcr.io/seqsense/protoc-assets:${IMAGE_TAG}
- name: Write tool versions to release notes
if: github.event_name == 'release'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
IMAGE_TAG=${GITHUB_REF#refs/tags/}
echo '## Tool versions' > ./notes
docker run ghcr.io/seqsense/protoc-assets cat /versions | xargs -L1 echo "-" >> ./notes
gh release edit \
--tag ${IMAGE_TAG} \
--title ${IMAGE_TAG} \
--notes-file ./notes
10 changes: 9 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ RUN --mount=type=cache,target=/etc/apk/cache,id=apk \
protoc \
py3-setuptools \
python3 \
ruby
ruby \
&& echo "common $(protoc --version)" >> /versions

ARG GLIBC_VERSION=2.33-r0
RUN --mount=type=cache,target=/etc/apk/cache,id=apk \
Expand All @@ -32,27 +33,34 @@ RUN --mount=type=cache,target=/etc/apk/cache,id=apk \
go \
&& go install google.golang.org/protobuf/cmd/protoc-gen-go \
&& go install google.golang.org/grpc/cmd/protoc-gen-go-grpc \
&& echo "go $(protoc-gen-go --version)" >> /versions \
&& echo "go $(protoc-gen-go-grpc --version)" >> /versions \
&& apk del .builddeps

COPY package.json package-lock.json /
RUN --mount=type=cache,target=/etc/apk/cache,id=apk \
apk add --no-cache --virtual .builddeps \
npm \
&& npm install \
&& echo "node grpc-tools $(npm view grpc-tools version)" >> /versions \
&& apk del .builddeps

COPY requirements.txt /
RUN --mount=type=cache,target=/etc/apk/cache,id=apk \
apk add --no-cache --virtual .builddeps \
py3-pip \
&& python3 -m pip install -r requirements.txt \
&& python3 -m pip show grpcio_tools \
| sed -n 's/^Version: \(.*\)$/python grpcio_tools \1/p' >> /versions \
&& apk del .builddeps

COPY Gemfile Gemfile.lock /
RUN --mount=type=cache,target=/etc/apk/cache,id=apk \
apk add --no-cache --virtual .builddeps \
ruby-bundler \
&& bundle install \
&& bundle show grpc-tools \
| sed -n 's|^/.*/grpc-tools-\(.*\)$|ruby grpc-tools \1|p'>> /versions \
&& apk del .builddeps

WORKDIR /defs

0 comments on commit 4ee7fd4

Please sign in to comment.