aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/debian_packages.yml
blob: babdeb6318085825d4089b959cdad2ac3b549b42 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Debian Packages
permissions: read-all
on:
  workflow_dispatch:
  push:
    tags:
      - '[0-9]+.[0-9]+.[0-9]+'
  pull_request:
    branches: [ main ]
jobs:
  test-packages:
    if: github.event.pull_request
    name: Test Packages
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
      with:
          fetch-depth: 0
    - name: Set up QEMU
      uses: docker/setup-qemu-action@v3
    - name: Set up Docker Buildx
      uses: docker/setup-buildx-action@v3
      id: buildx
      with:
          install: true
    - name: Available Docker Platforms
      run: echo ${{ steps.buildx.outputs.platforms }}
    - name: Build Debian Packages
      run: make debian-packages
    - name: List generated files
      run: ls -l *.deb
  build-packages-manually:
    if: github.event_name != 'pull_request' && github.event_name != 'push'
    name: Build Packages Manually
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
      with:
          fetch-depth: 0
    - name: Set up QEMU
      uses: docker/setup-qemu-action@v3
    - name: Set up Docker Buildx
      uses: docker/setup-buildx-action@v3
      id: buildx
      with:
          install: true
    - name: Available Docker Platforms
      run: echo ${{ steps.buildx.outputs.platforms }}
    - name: Build Debian Packages
      run: make debian-packages
    - name: Upload package
      uses: actions/upload-artifact@v4
      with:
        name: packages
        path: "*.deb"
        if-no-files-found: error
        retention-days: 3
  publish-packages:
    if: github.event_name == 'push'
    name: Publish Packages
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
      with:
          fetch-depth: 0
    - name: Set up QEMU
      uses: docker/setup-qemu-action@v3
    - name: Set up Docker Buildx
      uses: docker/setup-buildx-action@v3
      id: buildx
      with:
          install: true
    - name: Available Docker Platforms
      run: echo ${{ steps.buildx.outputs.platforms }}
    - name: Build Debian Packages
      run: make debian-packages
    - name: List generated files
      run: ls -l *.deb
    - name: Upload packages to repository
      env:
        FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
      run: for f in *.deb; do curl -F package=@$f https://$FURY_TOKEN@push.fury.io/miniflux/; done