Skip to content

Commit

Permalink
gh release cd gha (#8)
Browse files Browse the repository at this point in the history
* gh release cd gha

* sudo for apt

* make output dir before publish

* fix mkdir

* setup dotnet v4

* add release token

* paths option for docker ci

* only on main + v tagged pushes
  • Loading branch information
erikrose100 authored May 9, 2024
1 parent 616cd7a commit cee413e
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/docker-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
branches-ignore:
- "main"
paths:
- '**.cs'
- 'Dockerfile'

env:
TEST_TAG: user/app:test
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/dotnet-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: dotnet package

on:
push:
branches:
- main
tags:
- v**

env:
dotnet-version: '8.0.x'

jobs:
linux-x64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.dotnet-version }}
- name: Install project dependencies
run: dotnet restore
- name: Install dotnet AOT dependencies
run: |
sudo apt-get update \
&& sudo apt-get install -y --no-install-recommends \
clang zlib1g-dev
- run: sudo mkdir /app && sudo mkdir /app/linux-x64
- name: Compile exectuable
run: sudo dotnet publish -r linux-x64 -c Release -o /app/linux-x64/ CloseAsteroids.csproj
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
name: ${{ github.ref_name }}
token: ${{ secrets.RELEASE_TOKEN }}
files: |
/app/*

0 comments on commit cee413e

Please sign in to comment.