summaryrefslogtreecommitdiffstats
path: root/.github/workflows/on_release.yml
blob: 218119c9eda81a115d666cd380b56510cbc95cd8 (plain)
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: Upload binaries to release

on:
  release:
    types:
      - created
      - published
      - edited

  workflow_dispatch:

jobs:
  Ubuntu:
    name: Build for Ubuntu 20.04
    runs-on: ubuntu-20.04
    steps:
    - uses: actions/checkout@v2
    - name: prepare
      run: |
        sudo apt-get update
        sudo apt-get install -y autoconf automake autopoint autotools-dev \
                                gettext libdbus-1-dev pkg-config xmlto \
                                devscripts build-essential lintian \
                                debhelper-compat \
                                dh-exec libdbus-1-dev \
                                libmagick++-dev libv4l-dev python3-dev \
                                libgtk-3-dev lftp \
                                dh-sequence-python3 libgtk2.0-dev \
                                libqt5x11extras5-dev qtbase5-dev
    - name: build
      run: |
        .github/workflows/debuilder.sh
    - name: generating tarball
      run: |
        (cd ..; tar cvfz zbar-ubuntu-20.04.tar.gz *deb)

    - name: upload
      env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      uses: mchehab/upload-release-asset@v1.0.3
      with:
        upload_url: ${{ github.event.release.upload_url }}
        asset_path: ../zbar-ubuntu-20.04.tar.gz
        asset_name: zbar-ubuntu-20.04.tar.gz
        asset_content_type: application/gzip

  Mac_OS:
    name: Build for Mac OS
    runs-on: macos-latest
    steps:
    - uses: actions/checkout@v2
    - name: prepare
      run: |
        brew install gettext autoconf automake libiconv libtool \
                    gs graphicsmagick python xmlto pkg-config ccache

        brew unlink libtool && brew link libtool
        brew unlink gettext && brew link gettext
    - name: configure
      run:
        autoreconf -vfi

        ./configure --disable-video --disable-nls --with-python=python3

    - name: build
      run: |
        make
        DESTDIR=${PWD}/macos make install
    - name: generating tarball
      run: |
        DIR="$PWD"
        tar c -C ${PWD}/macos -f ${DIR}/zbar-macos.tar.gz -z .
    - name: upload
      env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      uses: mchehab/upload-release-asset@v1.0.3
      with:
        upload_url: ${{ github.event.release.upload_url }}
        asset_path: ./zbar-macos.tar.gz
        asset_name: zbar-macos.tar.gz
        asset_content_type: application/gzip

  Windows:
    name: Build for Windows
    runs-on: windows-latest
    strategy:
      matrix:
        arch: [x86_64, i686]
        video: [VfW, DShow]
        include:
          - arch: x86_64
            msystem: MINGW64
            grep: x86-64
          - arch: i686
            msystem: MINGW32
            grep: 386
          - video: DShow
            extra: --with-directshow
          - video: VfW
            extra:
    defaults:
      run:
        shell: msys2 {0}

    env:
      CPPFLAGS: -D__USE_MINGW_ANSI_STDIO=1

    steps:
    - uses: msys2/setup-msys2@v2
      with:
        msystem: ${{ matrix.msystem }}
        update: false
        install: >-
          mingw-w64-${{ matrix.arch }}-gcc
          mingw-w64-${{ matrix.arch }}-iconv
          mingw-w64-${{ matrix.arch }}-imagemagick
          mingw-w64-${{ matrix.arch }}-python
          base-devel git xmlto zip
          autoconf libtool automake gettext make autoconf-archive pkg-config

    - uses: actions/checkout@v2

    - name: configure
      shell: msys2 {0}
      run: |
        autoreconf -vfi
        ./configure LDFLAGS="-static" \
                    --enable-pthread --disable-dependency-tracking \
                    ${{ matrix.extra }}

    - name: build
      shell: msys2 {0}
      run:
        make
    - name: generating zip
      shell: msys2 {0}
      run: |
        DESTDIR=${PWD}/win_${{ matrix.arch }}-${{ matrix.video }} make install
        (cd ${PWD}/win_${{ matrix.arch }}-${{ matrix.video }}; zip -r ../zbar-win_${{ matrix.arch }}-${{ matrix.video }}.zip .)

    - name: upload
      env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      uses:  mchehab/upload-release-asset@v1.0.3
      with:
        upload_url: ${{ github.event.release.upload_url }}
        asset_path: ./zbar-win_${{ matrix.arch }}-${{ matrix.video }}.zip
        asset_name: zbar-win_${{ matrix.arch }}-${{ matrix.video }}.zip
        asset_content_type: application/gzip