45 lines
983 B
YAML
45 lines
983 B
YAML
name: Build and Upload
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: golang:1.22
|
|
options: --network host
|
|
|
|
outputs:
|
|
artifact_path: ${{ steps.build_app.outputs.artifact }}
|
|
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Dependencies
|
|
run: go mod tidy
|
|
|
|
- name: Build Application
|
|
id: build_app
|
|
run: |
|
|
mkdir -p dist
|
|
go build -o dist/serialToWebsocket .
|
|
echo "::set-output name=artifact::dist/serialToWebsocket"
|
|
|
|
upload:
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
|
|
steps:
|
|
- name: Download artifact from build job
|
|
run: echo "Artifact befindet sich in: ${{ needs.build.outputs.artifact_path }}"
|
|
- name: Upload Build Artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: serialToWebsocket
|
|
path: ${{ needs.build.outputs.artifact_path }}
|
|
|