Skip to content

docs(#15): Update Readme #16

docs(#15): Update Readme

docs(#15): Update Readme #16

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
jobs:
build-and-publish-release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
TARGET: arm64
- os: ubuntu-latest
TARGET: amd64
steps:
- name: Building ${{ matrix.TARGET }}
run: echo "${{ matrix.TARGET }}"
- uses: actions/checkout@master
- uses: actions/setup-go@v3
name: Set up Go
with:
go-version: 1.21
- name: Get version
id: get_version
uses: battila7/get-version-action@v2
- name: Build
run: GOOS=linux GOARCH=${{ matrix.TARGET }} CGO_ENABLED=0 go build -ldflags="-s -w -X github.com/nixys/nxs-data-anonymizer/ctx.version=${{ steps.get_version.outputs.version-without-v }}" -v -o nxs-data-anonymizer
- name: Compress
uses: a7ul/tar-action@v1.1.2
id: compress
with:
command: c
files: |
./nxs-data-anonymizer
./README.md
./LICENSE
outPath: nxs-data-anonymizer-${{ matrix.TARGET }}.tar.gz
- uses: actions/upload-artifact@v3
with:
name: nxs-data-anonymizer-${{ matrix.TARGET }}.tar.gz
path: nxs-data-anonymizer-${{ matrix.TARGET }}.tar.gz
- uses: softprops/action-gh-release@v1
name: Upload binaries to release
if: github.ref_type == 'tag'
with:
files: nxs-data-anonymizer-${{ matrix.TARGET }}.tar.gz
prerelease: ${{ contains(github.ref_name, 'rc') }}
generate_release_notes: true
append_body: true
build-and-push-docker:
runs-on: ubuntu-latest
environment: secure
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get version
id: get_version
uses: battila7/get-version-action@v2
- name: Login to Registry Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Docker meta for app
id: meta-app
uses: docker/metadata-action@v4
with:
images: |
nixyslab/nxs-data-anonymizer
- name: Build and push app
uses: docker/build-push-action@v4
with:
context: .
file: .docker/Dockerfile
push: true
tags: ${{ steps.meta-app.outputs.tags }}
build-args: APP_VERSION=${{ steps.get_version.outputs.version-without-v }}"