Skip to content

release

release #17

Workflow file for this run

name: release
on:
release:
types: [created]
jobs:
releases-matrix:
name: Release feishu2md binaries
runs-on: ubuntu-latest
strategy:
matrix:
# goos: [linux, windows, darwin]
goos: [linux, windows] # exclude darwin, see #40
goarch: [amd64, arm64]
exclude:
- goarch: arm64
goos: windows
steps:
- name: Checkout the code
uses: actions/checkout@v2
- name: Parallel build
uses: wangyoucao577/go-release-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: "go.mod"
pre_command: export CGO_ENABLED=0
ldflags: "-s -w -X main.version=${{ github.event.release.tag_name }}"
executable_compression: "upx -9"
project_path: "./cmd"
binary_name: "feishu2md"
extra_files: README.md
releases-darwin:
name: Release feishu2md binaries
runs-on: ubuntu-latest
strategy:
matrix:
goos: [darwin] # specialize for darwin, see #40
goarch: [amd64, arm64]
steps:
- name: Checkout the code
uses: actions/checkout@v2
- name: Parallel build
uses: wangyoucao577/go-release-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: "go.mod"
pre_command: export CGO_ENABLED=0
ldflags: "-s -w -X main.version=${{ github.event.release.tag_name }}"
project_path: "./cmd"
binary_name: "feishu2md"
extra_files: README.md
release-docker:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: wwwsine/feishu2md
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}