Bump github.com/spyzhov/ajson from 0.9.0 to 0.9.1 (#49) #156
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
name: build | |
on: | |
push: | |
branches: | |
- main | |
- "feature/**" | |
tags: | |
- v* | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v3 | |
- name: setup go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.19 | |
- name: test | |
run: | | |
export GOTESTSUM_VERSION=1.8.2 | |
curl -L https://github.com/gotestyourself/gotestsum/releases/download/v${GOTESTSUM_VERSION}/gotestsum_${GOTESTSUM_VERSION}_linux_amd64.tar.gz | sudo tar -C /usr/local/bin -xz | |
gotestsum --format short-verbose --no-summary=skipped ./... | |
- name: build | |
uses: goreleaser/goreleaser-action@master | |
with: | |
version: latest | |
args: --skip-publish --skip-validate --snapshot | |
- name: prepare dist directory | |
run: | | |
find ./dist/ -not -name '*.tar.gz' -not -name '*.zip' -not -name 'dist' -not -wholename './dist/grpc-ditto_linux_amd*' -not -name 'pkg' -delete | |
cp Dockerfile dist/ | |
- name: store artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: dist | |
path: | | |
dist | |
release: | |
name: release | |
outputs: | |
release_url: ${{ steps.create_release.outputs.upload_url }} | |
needs: build | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- name: download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: dist | |
- name: prep | |
id: prep | |
run: | | |
find . -name "grpc-ditto*" -type f -exec chmod +x {} \; | |
echo ::set-output name=tags::${GITHUB_REF#refs/tags/v} | |
- name: create release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} | |
body: | | |
v${{ steps.prep.outputs.tags }} | |
draft: false | |
prerelease: true | |
- name: set up docker buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: login to github container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: build and push | |
uses: docker/build-push-action@v3 | |
with: | |
context: grpc-ditto_linux_amd64_v1 | |
file: ./Dockerfile | |
push: true | |
tags: | | |
ghcr.io/vadimi/grpc-ditto:latest | |
ghcr.io/vadimi/grpc-ditto:${{ steps.prep.outputs.tags }} | |
upload-artifacts: | |
name: upload-artifacts | |
needs: release | |
runs-on: ubuntu-latest | |
steps: | |
- name: download artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
name: dist | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: pkg/grpc-ditto* | |
tag: ${{ github.ref }} | |
overwrite: true | |
file_glob: true |