generated from pi-ux-ce/dotnet_build
add CI/cd file from template
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Successful in 2m1s
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Successful in 2m1s
This commit is contained in:
@@ -17,10 +17,13 @@ jobs:
|
||||
run: |
|
||||
latest="${{ vars.VERSION }}"
|
||||
next_version=$(echo "$latest" | awk -F. -v OFS=. '{$NF += 1 ; print}')
|
||||
echo "Next version: $next_version"
|
||||
echo "next_version=$next_version" >> $GITHUB_ENV
|
||||
echo "${{ vars.EXECUTABLE_NAME }}"
|
||||
echo "${{ vars.RUNTIME }}"
|
||||
echo "Variables used :"
|
||||
echo "------------------------------------------------"
|
||||
echo "Next version: $next_version"
|
||||
echo "EXECUTABLE_NAME: ${{ vars.EXECUTABLE_NAME }}"
|
||||
echo "RUNTIME: ${{ vars.RUNTIME }}"
|
||||
echo "TARGET_FRAMEWORK: ${{ vars.TARGET_FRAMEWORK }}"
|
||||
- name: Setup dotnet
|
||||
uses: actions/setup-dotnet@v3
|
||||
with:
|
||||
@@ -30,16 +33,16 @@ jobs:
|
||||
- name: Test with dotnet
|
||||
run: dotnet test --logger trx --results-directory "TestResults-net8.0"
|
||||
- name: Build the package
|
||||
run: dotnet build -p:Version=$next_version,FileVersion=$next_version,AssemblyVersion=$next_version,InformationalVersion=$next_version
|
||||
run: dotnet build
|
||||
- name: Publish the package
|
||||
run: dotnet publish -p:PublishSingleFile=true,AssemblyName=${{ vars.EXECUTABLE_NAME }},Version=$next_version,FileVersion=$next_version,AssemblyVersion=$next_version,InformationalVersion=$next_version --self-contained false --runtime win-x64
|
||||
run: dotnet publish -p:PublishSingleFile=true,AssemblyName=${{ vars.EXECUTABLE_NAME }},Version=$next_version,FileVersion=$next_version,AssemblyVersion=$next_version,InformationalVersion=$next_version --self-contained false --runtime ${{ vars.RUNTIME }}
|
||||
|
||||
- name: List all files
|
||||
run: |
|
||||
find /workspace
|
||||
|
||||
- name: copy the release before compression
|
||||
run: cp -r /workspace/pi-ux-ce/${{ github.event.repository.name }}/bin/Release/net8.0/${{ vars.RUNTIME }}/publish/ .
|
||||
run: cp -r /workspace/pi-ux-ce/${{ github.event.repository.name }}/bin/Release/${{ vars.TARGET_FRAMEWORK }}/${{ vars.RUNTIME }}/publish/ .
|
||||
- uses: montudor/action-zip@v1
|
||||
with:
|
||||
args: zip -qq -r ${{ github.event.repository.name }}.zip publish/
|
||||
@@ -68,7 +71,7 @@ jobs:
|
||||
- name: upload latest executable version with version number
|
||||
run: |
|
||||
curl --user ${{ secrets.USERNAME_GITEA }}:${{ secrets.PASSWORD_GITEA }} \
|
||||
--upload-file /workspace/pi-ux-ce/${{ github.event.repository.name }}/bin/Release/net8.0/${{ vars.RUNTIME }}/publish/${{ vars.EXECUTABLE_NAME }}.exe \
|
||||
--upload-file /workspace/pi-ux-ce/${{ github.event.repository.name }}/bin/Release/${{ vars.TARGET_FRAMEWORK }}/${{ vars.RUNTIME }}/publish/${{ vars.EXECUTABLE_NAME }}.exe \
|
||||
"https://gitea.tryton.geeraert.eu/api/packages/pi-ux-ce/generic/${{ github.event.repository.name }}/$next_version/${{ github.event.repository.name }}.exe"
|
||||
|
||||
|
||||
@@ -80,7 +83,7 @@ jobs:
|
||||
- name: upload latest executable version
|
||||
run: |
|
||||
curl --user ${{ secrets.USERNAME_GITEA }}:${{ secrets.PASSWORD_GITEA }} \
|
||||
--upload-file /workspace/pi-ux-ce/${{ github.event.repository.name }}/bin/Release/net8.0/${{ vars.RUNTIME }}/publish/${{ vars.EXECUTABLE_NAME }}.exe \
|
||||
--upload-file /workspace/pi-ux-ce/${{ github.event.repository.name }}/bin/Release/${{ vars.TARGET_FRAMEWORK }}/${{ vars.RUNTIME }}/publish/${{ vars.EXECUTABLE_NAME }}.exe \
|
||||
https://gitea.tryton.geeraert.eu/api/packages/pi-ux-ce/generic/${{ github.event.repository.name }}/latest/${{ vars.EXECUTABLE_NAME }}.exe
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user