Skip to content

add content-type to assets #7

add content-type to assets

add content-type to assets #7

Workflow file for this run

name: start.go Build and Launch Releases
on:
push:
branches:
- start-go
- master
paths:
- 'start/start.go'
- 'start/compose.yml'
- 'start/.env.example'
- '.github/workflows/build_startgo.yml'
jobs:
build:
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- { runner: macos-latest, os: darwin, arch: amd64, tags: netcgo }
- { runner: macos-latest, os: darwin, arch: arm64, tags: netcgo }
- { runner: ubuntu-latest, os: linux, arch: amd64, env: CGO_ENABLED=0 }
- { runner: ubuntu-latest, os: linux, arch: arm64, env: CGO_ENABLED=0 }
- { runner: ubuntu-latest, os: windows, arch: amd64, env: CGO_ENABLED=0, extension: ".exe" }
- { runner: ubuntu-latest, os: windows, arch: arm64, env: CGO_ENABLED=0, extension: ".exe" }
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21.5'
- name: Build Go app
working-directory: ./start
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
run: |
${{ matrix.env }} go build -tags="${{ matrix.tags }}" -o start${{ matrix.extension }} .
- name: Prepare Launch Release Files
env:
ZIP_NAME: dkn-${{ matrix.os }}-${{ matrix.arch }}
run: |
mkdir $ZIP_NAME
cp ./start/start${{ matrix.extension }} $ZIP_NAME/start${{ matrix.extension }}
cp ./compose.yml $ZIP_NAME/
cp ./.env.example $ZIP_NAME/
zip -r $ZIP_NAME.zip $ZIP_NAME
- name: Upload Launch Artifacts
uses: actions/upload-artifact@v4
with:
name: dkn-${{ matrix.os }}-${{ matrix.arch }}
path: dkn-${{ matrix.os }}-${{ matrix.arch }}.zip
release:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/start-go'
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Download Launch Artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
path: ./artifacts
- name: Create release with artifacts
uses: ncipollo/release-action@v1
with:
name: v0.1.7-launch
tag: v0.1.7-launch
artifacts: "artifacts/*"
artifactContentType: application/zip
draft: true