Files
dhl/.gitea/workflows/release.yaml
danielvici123 aab934d05b
Some checks failed
Build and Release / Build Linux (push) Failing after 1m5s
Build and Release / Build Windows (push) Has been cancelled
Build and Release / Create Release (push) Has been cancelled
ci: fix rust setup action
2026-06-08 21:34:30 +02:00

95 lines
2.4 KiB
YAML

name: Build and Release
on:
push:
tags:
- 'v*'
jobs:
build-linux:
name: Build Linux
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Build
run: cargo build --release
- name: Package Linux
run: |
mkdir -p dist-linux
cp target/release/dhl dist-linux/dhl
cp config.json.example dist-linux/config.json
cp response.json.example dist-linux/response.json
tar -czvf dhl-linux.tar.gz -C dist-linux .
- name: Upload Linux Artifact
uses: actions/upload-artifact@v4
with:
name: dhl-linux
path: dhl-linux.tar.gz
build-windows:
name: Build Windows
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Build
run: cargo build --release
- name: Package Windows
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path dist-windows
Copy-Item target/release/dhl.exe dist-windows/dhl.exe
Copy-Item config.json.example dist-windows/config.json
Copy-Item response.json.example dist-windows/response.json
Compress-Archive -Path dist-windows/* -DestinationPath dhl-windows.zip
- name: Upload Windows Artifact
uses: actions/upload-artifact@v4
with:
name: dhl-windows
path: dhl-windows.zip
create-release:
name: Create Release
needs: [build-linux, build-windows]
runs-on: ubuntu-latest
steps:
- name: Download Linux Artifact
uses: actions/download-artifact@v4
with:
name: dhl-linux
path: .
- name: Download Windows Artifact
uses: actions/download-artifact@v4
with:
name: dhl-windows
path: .
- name: Create Gitea Release
uses: softprops/action-gh-release@v2
with:
files: |
dhl-linux.tar.gz
dhl-windows.zip
name: Release ${{ github.ref_name }}
tag_name: ${{ github.ref }}
generate_release_notes: true
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_API_URL: ${{ github.api_url }}