1
0
mirror of https://github.com/pcvolkmer/osc-variant.git synced 2025-12-12 14:13:20 +00:00
Files
osc-variant/.github/workflows/ci.yml

73 lines
1.9 KiB
YAML

name: CI
on:
pull_request:
branches: [ 'master' ]
push:
branches: [ 'master' ]
release:
types: [ 'created' ]
permissions:
contents: read
env:
# Use invalid OSB key to packages with ZIP support but without valid build in password
OSB_KEY: "invalid"
CARGO_TERM_COLOR: always
jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run tests
run: cargo test --release --verbose
linuxbuild:
name: Create Linux Package
runs-on: ubuntu-latest
needs:
- test
permissions:
contents: write
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- name: Setup
run: sudo apt update && sudo apt install rpm && cargo install cargo-deb && cargo install cargo-generate-rpm
- run: make linux-package linux-deb linux-rpm
- name: Release
if: ${{ github.event_name == 'release' && github.event.action == 'created' }}
uses: softprops/action-gh-release@v2
with:
files: |
*.tar.gz
*.deb
*.rpm
- name: Upload to Repository
if: ${{ github.event_name == 'release' && github.event.action == 'created' }}
run: |
curl -L --user dnpm:${{ secrets.PACKAGE_TOKEN }} --upload-file *.deb ${{ vars.DEB_UPLOAD_URL }}
curl -L --user dnpm:${{ secrets.PACKAGE_TOKEN }} --upload-file *.rpm ${{ vars.RPM_UPLOAD_URL }}
windowsbuild:
name: Create Windows Package
runs-on: windows-latest
needs:
- test
permissions:
contents: write
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- run: make win-package
- name: Release
if: ${{ github.event_name == 'release' && github.event.action == 'created' }}
uses: softprops/action-gh-release@v2
with:
files: |
*win64.zip