Skip to content

Build πŸ“¦ and Release πŸš€ #1

Build πŸ“¦ and Release πŸš€

Build πŸ“¦ and Release πŸš€ #1

Workflow file for this run

name: Build πŸ“¦ and Release πŸš€
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build:
name: Build πŸ“¦
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-latest, macos-latest, windows-latest]
arch: [amd64]
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v3
- name: Build
run: GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o sheets-to-csv-${{ matrix.os }}-${{ matrix.arch }}
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: sheets-to-csv-${{ matrix.os }}-${{ matrix.arch }}
path: sheets-to-csv-${{ matrix.os }}-${{ matrix.arch }}
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Asset πŸš€
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./sheets-to-csv-${{ matrix.os }}-${{ matrix.arch }}
asset_name: sheets-to-csv-${{ matrix.os }}-${{ matrix.arch }}
asset_content_type: application/octet-stream