Working an Action

This commit is contained in:
simon 2025-03-22 16:00:00 +01:00
parent 4e1ebdedb5
commit 18c57b8c6c
3 changed files with 20 additions and 27 deletions

View File

@ -1,4 +1,4 @@
name: Build and Test Golang
name: Build and Upload
on:
push:
@ -8,26 +8,37 @@ on:
jobs:
build:
runs-on: ubuntu-latest
container:
image: golang:1.22 # Aktuelle Version verwenden
image: golang:1.22
options: --network host
outputs:
artifact_path: ${{ steps.build_app.outputs.artifact }}
steps:
# Schritt 1: Repository klonen
- name: Checkout Code
uses: actions/checkout@v4
# Schritt 2: Abhängigkeiten installieren
- name: Install Dependencies
run: go mod tidy
# Schritt 3: Code bauen
- name: Build Application
run: go build .
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: .
path: ${{ needs.build.outputs.artifact_path }}

View File

@ -1,19 +0,0 @@
name: Gitea Actions Demo
run-name: ${{ gitea.actor }} is testing out Gitea Actions
on: [push]
jobs:
Explore-Gitea-Actions:
runs-on: ubuntu-latest
steps:
- run: echo " The job was automatically triggered by a ${{ gitea.event_name }} event."
- run: echo " This job is now running on a ${{ runner.os }} server hosted by Gitea!"
- run: echo " The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- run: echo " The ${{ gitea.repository }} repository has been cloned to the runner."
- run: echo " The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: |
ls ${{ gitea.workspace }}
- run: echo " This job's status is ${{ job.status }}."

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
serialToWebsocket