|
| 1 | +# ============= |
| 2 | +# This file is automatically generated from the templates in stackabletech/operator-templating |
| 3 | +# DON'T MANUALLY EDIT THIS FILE |
| 4 | +# ============= |
| 5 | +name: Publish-Release-Artifacts |
| 6 | + |
| 7 | +on: |
| 8 | + push: |
| 9 | + tags: |
| 10 | + - "*" |
| 11 | + |
| 12 | +env: |
| 13 | + PRODUCT_NAME: trino |
| 14 | + CARGO_TERM_COLOR: always |
| 15 | + CARGO_INCREMENTAL: '0' |
| 16 | + CARGO_PROFILE_DEV_DEBUG: '0' |
| 17 | + RUSTFLAGS: "-D warnings -W rust-2021-compatibility" |
| 18 | + REPO_APT_RELEASE_URL: https://repo.stackable.tech/repository/deb-release |
| 19 | + REPO_RPM_RELEASE_URL: https://repo.stackable.tech/repository/rpm-release |
| 20 | + |
| 21 | +jobs: |
| 22 | + debian10: |
| 23 | + runs-on: debian10 |
| 24 | + steps: |
| 25 | + - uses: actions/checkout@v2 |
| 26 | + - name: Change version if is PR |
| 27 | + if: ${{ github.event_name == 'pull_request' }} |
| 28 | + # We use "mr" instead of "pr" to denote pull request builds, as this prefix comes before "nightly" when lexically |
| 29 | + # sorting packages by version. This means that when installing the package without specifying a version the |
| 30 | + # nighly version is considered more current than mr versions and installed by default |
| 31 | + run: sed -i -e 's/^version = "\([0-9]\+\.[0-9]\+\.[0-9]\+\).*/version = "\1-mr${{ github.event.number }}"/' rust/operator-binary/Cargo.toml |
| 32 | + - name: Build |
| 33 | + run: ~/.cargo/bin/cargo +nightly build --verbose --release |
| 34 | + - name: Build apt package |
| 35 | + run: ~/.cargo/bin/cargo deb --manifest-path rust/operator-binary/Cargo.toml --no-build |
| 36 | + - name: Publish apt package |
| 37 | + env: |
| 38 | + NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} |
| 39 | + if: env.NEXUS_PASSWORD != null |
| 40 | + run: >- |
| 41 | + /usr/bin/curl |
| 42 | + --fail |
| 43 | + -u 'github:${{ secrets.NEXUS_PASSWORD }}' |
| 44 | + -H "Content-Type: multipart/form-data" |
| 45 | + --data-binary "@./$(find target/debian/ -name *.deb)" |
| 46 | + "${{ env.REPO_APT_RELEASE_URL }}/" |
| 47 | + - name: Clean |
| 48 | + run: ~/.cargo/bin/cargo clean |
| 49 | + |
| 50 | + centos: |
| 51 | + runs-on: centos${{ matrix.node }} |
| 52 | + strategy: |
| 53 | + matrix: |
| 54 | + node: [ 7, 8 ] |
| 55 | + steps: |
| 56 | + - uses: actions/checkout@v2 |
| 57 | + - name: Change version if is PR |
| 58 | + if: ${{ github.event_name == 'pull_request' }} |
| 59 | + # We use "mr" instead of "pr" to denote pull request builds, as this prefix comes before "nightly" when lexically |
| 60 | + # sorting packages by version. This means that when installing the package without specifying a version the |
| 61 | + # nighly version is considered more current than mr versions and installed by default |
| 62 | + run: sed -i -e 's/^version = "\([0-9]\+\.[0-9]\+\.[0-9]\+\).*/version = "\1-mr${{ github.event.number }}"/' rust/operator-binary/Cargo.toml |
| 63 | + - name: Build |
| 64 | + run: ~/.cargo/bin/cargo +nightly build --verbose --release |
| 65 | + - name: Build RPM package |
| 66 | + run: packaging/buildrpm.sh stackable-${{ env.PRODUCT_NAME }}-operator-binary stackable-${{ env.PRODUCT_NAME }}-operator |
| 67 | + - name: Publish RPM package |
| 68 | + env: |
| 69 | + NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} |
| 70 | + if: env.NEXUS_PASSWORD != null |
| 71 | + run: >- |
| 72 | + /usr/bin/curl |
| 73 | + --fail |
| 74 | + -u 'github:${{ secrets.NEXUS_PASSWORD }}' |
| 75 | + --upload-file "./$(find target/rpm/RPMS/x86_64/ -name *.rpm)" |
| 76 | + "${{ env.REPO_RPM_RELEASE_URL }}/el${{ matrix.node }}/" |
| 77 | + - name: Clean |
| 78 | + run: ~/.cargo/bin/cargo clean |
0 commit comments