add CI and the new release
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Failing after 5m46s
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Failing after 5m46s
This commit is contained in:
@@ -0,0 +1,89 @@
|
||||
name: Gitea Actions Demo
|
||||
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
Explore-Gitea-Actions:
|
||||
strategy:
|
||||
matrix:
|
||||
dotnet-version: [ '8.0.x' ]
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Compute next version
|
||||
id: versioning
|
||||
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
|
||||
|
||||
- name: Setup dotnet
|
||||
uses: actions/setup-dotnet@v3
|
||||
with:
|
||||
dotnet-version: ${{ matrix.dotnet-version }}
|
||||
- name: Install dependencies
|
||||
run: dotnet restore
|
||||
- name: Test with dotnet
|
||||
run: dotnet test --logger trx --results-directory "TestResults-${{ matrix.dotnet-version }}"
|
||||
- name: Build the package
|
||||
run: dotnet build -p:Version=$next_version
|
||||
- name: Publish the package
|
||||
run: dotnet publish -p:PublishSingleFile=true --self-contained false --runtime win-x64
|
||||
- name: copy the release before compression
|
||||
run: cp -r /workspace/pi-ux-ce/backup-utilities/bin/Release/net8.0/win-x64/publish/ .
|
||||
- uses: montudor/action-zip@v1
|
||||
with:
|
||||
args: zip -qq -r backup-utilities.zip publish/
|
||||
#working-directory: path/to/work-dir
|
||||
- name: List all files
|
||||
run: |
|
||||
find /workspace/pi-ux-ce/backup-utilities/bin
|
||||
|
||||
- name: Delete existing latest version
|
||||
run: |
|
||||
curl --user ${{ secrets.USERNAME_GITEA }}:${{ secrets.PASSWORD_GITEA }} -X DELETE \
|
||||
https://gitea.tryton.geeraert.eu/api/packages/pi-ux-ce/generic/backup-utilities/latest/backup-utilities.exe
|
||||
|
||||
- name: Delete existing latest version
|
||||
run: |
|
||||
curl --user ${{ secrets.USERNAME_GITEA }}:${{ secrets.PASSWORD_GITEA }} -X DELETE \
|
||||
https://gitea.tryton.geeraert.eu/api/packages/pi-ux-ce/generic/backup-utilities/latest/backup-utilities.zip
|
||||
|
||||
- name: upload latest zip version with version number
|
||||
run: |
|
||||
curl --user ${{ secrets.USERNAME_GITEA }}:${{ secrets.PASSWORD_GITEA }} \
|
||||
--upload-file backup-utilities.zip \
|
||||
https://gitea.tryton.geeraert.eu/api/packages/pi-ux-ce/generic/backup-utilities/$next_version/backup-utilities.zip
|
||||
|
||||
|
||||
- name: upload latest executable version with version number
|
||||
run: |
|
||||
curl --user ${{ secrets.USERNAME_GITEA }}:${{ secrets.PASSWORD_GITEA }} \
|
||||
--upload-file /workspace/pi-ux-ce/backup-utilities/bin/Release/net8.0/win-x64/publish/backup-utilities.exe \
|
||||
"https://gitea.tryton.geeraert.eu/api/packages/pi-ux-ce/generic/backup-utilities/$next_version/backup-utilities.exe"
|
||||
|
||||
|
||||
- name: upload latest zip version
|
||||
run: |
|
||||
curl --user ${{ secrets.USERNAME_GITEA }}:${{ secrets.PASSWORD_GITEA }} \
|
||||
--upload-file backup-utilities.zip \
|
||||
https://gitea.tryton.geeraert.eu/api/packages/pi-ux-ce/generic/backup-utilities/latest/backup-utilities.zip
|
||||
|
||||
|
||||
- name: upload latest executable version
|
||||
run: |
|
||||
curl --user ${{ secrets.USERNAME_GITEA }}:${{ secrets.PASSWORD_GITEA }} \
|
||||
--upload-file /workspace/pi-ux-ce/backup-utilities/bin/Release/net8.0/win-x64/publish/backup-utilities.exe \
|
||||
https://gitea.tryton.geeraert.eu/api/packages/pi-ux-ce/generic/backup-utilities/latest/backup-utilities.exe
|
||||
|
||||
|
||||
- name: update version in the variable
|
||||
run: |
|
||||
curl -X PUT -H "Content-Type: application/json" \
|
||||
--user ${{ secrets.USERNAME_GITEA }}:${{ secrets.PASSWORD_GITEA }} \
|
||||
https://gitea.tryton.geeraert.eu/api/v1/repos/pi-ux-ce/backup-utilities/actions/variables/VERSION \
|
||||
-d "{\"Value\":\"$next_version\"}"
|
||||
Reference in New Issue
Block a user