diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index b9f3337..3736296 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -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 }} + diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml deleted file mode 100644 index fedb90d..0000000 --- a/.gitea/workflows/demo.yaml +++ /dev/null @@ -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 }}." diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5a54029 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +serialToWebsocket