revert 7d70117e8c90159479aa4439c3b6cedba242da6d
All checks were successful
Build / build (push) Successful in 1m12s
All checks were successful
Build / build (push) Successful in 1m12s
revert Update .gitea/workflows/build.yml
This commit is contained in:
parent
7d70117e8c
commit
83b967674b
@ -1,61 +1,54 @@
|
||||
name: Build & Release
|
||||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
tags:
|
||||
- 'v*' # Only run for version tags
|
||||
- 'v*'
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
release:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v3
|
||||
with:
|
||||
dotnet-version: '9.0.x'
|
||||
|
||||
- name: Build & Package
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore FireflyClient.sln
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
dotnet publish -c Release -o artifacts/release
|
||||
mkdir -p artifacts/packages
|
||||
cd artifacts/release
|
||||
zip -r ../packages/firefly-${GITHUB_REF#refs/tags/}.zip .
|
||||
chmod +x build-all.sh
|
||||
./build-all.sh
|
||||
|
||||
- name: Extract Tag Name
|
||||
- name: Verify artifacts
|
||||
run: |
|
||||
TAG_NAME="${GITHUB_REF#refs/tags/}"
|
||||
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
|
||||
ls -la artifacts/exe || echo "No exe artifacts found"
|
||||
ls -la artifacts/native || echo "No native artifacts found"
|
||||
|
||||
- name: Create Release in Gitea
|
||||
run: |
|
||||
RELEASE_DATA=$(curl -s -X POST "${GITEA_URL}/api/v1/repos/${GITEA_REPO}/releases" \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{
|
||||
\"tag_name\": \"${TAG_NAME}\",
|
||||
\"name\": \"Release ${TAG_NAME}\",
|
||||
\"body\": \"Automated release for ${TAG_NAME}\",
|
||||
\"draft\": false,
|
||||
\"prerelease\": false
|
||||
}")
|
||||
- name: Upload artifacts
|
||||
if: ${{ !env.ACT }}
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: firefly-artifacts
|
||||
path: |
|
||||
artifacts/exe
|
||||
artifacts/native
|
||||
|
||||
echo "Release created: $RELEASE_DATA"
|
||||
RELEASE_ID=$(echo "$RELEASE_DATA" | jq '.id')
|
||||
|
||||
if [ -z "$RELEASE_ID" ] || [ "$RELEASE_ID" = "null" ]; then
|
||||
echo "Failed to retrieve release ID. Exiting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
curl -X POST "${GITEA_URL}/api/v1/repos/${GITEA_REPO}/releases/${RELEASE_ID}/assets?name=firefly-${TAG_NAME}.zip" \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
-H "Content-Type: application/zip" \
|
||||
--data-binary @artifacts/packages/firefly-${TAG_NAME}.zip
|
||||
|
||||
env:
|
||||
GITEA_URL: https://gitea.innovativedevsolutions.org
|
||||
GITEA_REPO: IDSolutions/fireflyclient
|
||||
GITEA_TOKEN: ${{ secrets.NET_TOKEN }}
|
||||
- name: Create Release
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: |
|
||||
artifacts/exe/**
|
||||
artifacts/native/**
|
||||
generate_release_notes: true
|
Loading…
x
Reference in New Issue
Block a user