Template
Gitea Actions Demo / Explore-Gitea-Actions (8.0.x) (push) Failing after 1m37s
92 lines
4.4 KiB
YAML
92 lines
4.4 KiB
YAML
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
|
|
echo "${{ vars.EXECUTABLE_NAME }}"
|
|
echo "${{ vars.RUNTIME }}"
|
|
- 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,AssemblyName=${{ vars.EXECUTABLE_NAME }} --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/${{ matrix.dotnet-version }}/${{ vars.RUNTIME }}/publish/ .
|
|
- uses: montudor/action-zip@v1
|
|
with:
|
|
args: zip -qq -r ${{ github.event.repository.name }}.zip publish/
|
|
#working-directory: path/to/work-dir
|
|
- name: List all files
|
|
run: |
|
|
find /workspace/pi-ux-ce/${{ github.event.repository.name }}/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/${{ github.event.repository.name }}/latest/${{ vars.EXECUTABLE_NAME }}.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/${{ github.event.repository.name }}/latest/${{ vars.EXECUTABLE_NAME }}.zip
|
|
|
|
- name: upload latest zip version with version number
|
|
run: |
|
|
curl --user ${{ secrets.USERNAME_GITEA }}:${{ secrets.PASSWORD_GITEA }} \
|
|
--upload-file ${{ github.event.repository.name }}.zip \
|
|
https://gitea.tryton.geeraert.eu/api/packages/pi-ux-ce/generic/${{ github.event.repository.name }}/$next_version/${{ github.event.repository.name }}.zip
|
|
|
|
|
|
- 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/${{ matrix.dotnet-version }}/${{ 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"
|
|
|
|
|
|
- name: upload latest zip version
|
|
run: |
|
|
curl --user ${{ secrets.USERNAME_GITEA }}:${{ secrets.PASSWORD_GITEA }} \
|
|
--upload-file ${{ github.event.repository.name }}.zip \
|
|
https://gitea.tryton.geeraert.eu/api/packages/pi-ux-ce/generic/${{ github.event.repository.name }}/latest/${{ vars.EXECUTABLE_NAME }}.zip
|
|
- 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/${{ matrix.dotnet-version }}/${{ vars.RUNTIME }}/publish/OnpremsTools.exe \
|
|
https://gitea.tryton.geeraert.eu/api/packages/pi-ux-ce/generic/${{ github.event.repository.name }}/latest/${{ vars.EXECUTABLE_NAME }}.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/${{ github.event.repository.name }}/actions/variables/VERSION \
|
|
-d "{\"Value\":\"$next_version\"}"
|