|
1 | 1 | name: Upload AUR
|
2 |
| - |
3 |
| -on: |
4 |
| - release: |
5 |
| - types: [created] |
| 2 | +on: push |
| 3 | +#on: |
| 4 | +# release: |
| 5 | +# types: [created] |
6 | 6 |
|
7 | 7 | jobs:
|
8 |
| - build: |
| 8 | + tpi-bin: |
9 | 9 | runs-on: ubuntu-latest
|
10 | 10 | steps:
|
11 | 11 | - name: Checkout Code
|
12 | 12 | uses: actions/checkout@v4
|
13 | 13 | - name: generate PKGBUILD
|
14 | 14 | run: |
|
15 |
| - cp scripts/ci/PKGBUILD . |
16 |
| - PACKAGE_NAME=$(grep '^name =' Cargo.toml | sed 's/name = "\(.*\)"/\1/') |
| 15 | + cp scripts/ci/PKGBUILD.bin ./PKGBUILD |
| 16 | + PACKAGE_NAME=$(grep '^name =' Cargo.toml | sed 's/name = "\(.*\)"/\1/')-bin |
17 | 17 | VERSION=$(grep '^version =' Cargo.toml | sed 's/version = "\(.*\)"/\1/')
|
18 | 18 | MAINTAINER=$(grep '^authors =' Cargo.toml | sed 's/authors = \[\s*"\(.*\)\s*"\]/\1/')
|
19 | 19 | DESCRIPTION=$(grep '^description =' Cargo.toml | sed 's/description = "\(.*\)"/\1/')
|
|
37 | 37 | commit_email: 'noreply@turingpi.com'
|
38 | 38 | ssh_private_key: ${{ secrets.AUR_DEPLOY_KEY }}
|
39 | 39 | commit_message: Update package to ${{ env.VERSION }}
|
| 40 | + |
| 41 | + tpi-src: |
| 42 | + runs-on: ubuntu-latest |
| 43 | + strategy: |
| 44 | + matrix: |
| 45 | + name: |
| 46 | + - master |
| 47 | + - git |
| 48 | + steps: |
| 49 | + - name: Checkout Code |
| 50 | + uses: actions/checkout@v4 |
| 51 | + - name: generate PKGBUILD |
| 52 | + run: | |
| 53 | + cp scripts/ci/PKGBUILD ./PKGBUILD |
| 54 | + PACKAGE_NAME=$(grep '^name =' Cargo.toml | sed 's/name = "\(.*\)"/\1/') |
| 55 | + VERSION=$(grep '^version =' Cargo.toml | sed 's/version = "\(.*\)"/\1/') |
| 56 | + MAINTAINER=$(grep '^authors =' Cargo.toml | sed 's/authors = \[\s*"\(.*\)\s*"\]/\1/') |
| 57 | + DESCRIPTION=$(grep '^description =' Cargo.toml | sed 's/description = "\(.*\)"/\1/') |
| 58 | + if [[ ${{ matrix.name }} == "master" ]]; then |
| 59 | + TAG="" |
| 60 | + PACKAGE_NAME=${PACKAGE_NAME}-git |
| 61 | + else |
| 62 | + TAG="#tag=v${VERSION}" |
| 63 | + fi |
| 64 | + sed -i "1i # Maintainer: ${MAINTAINER}" PKGBUILD |
| 65 | + sed -i "2i pkgname=${PACKAGE_NAME}" PKGBUILD |
| 66 | + sed -i "3i pkgver=${VERSION}" PKGBUILD |
| 67 | + sed -i "4i pkgdesc='${DESCRIPTION}'" PKGBUILD |
| 68 | + sed -i "5i source=(\"git+https://github.com/turing-machines/tpi.git${TAG}\")" PKGBUILD |
| 69 | +
|
| 70 | + install=$(cat scripts/ci/install) |
| 71 | + echo "package() {" >> PKGBUILD |
| 72 | + echo " TARGET=\$CARCH-unknown-linux-gnu" >> PKGBUILD |
| 73 | + echo "$install" >> PKGBUILD |
| 74 | + echo -e "}\n" >> PKGBUILD |
| 75 | +
|
| 76 | + echo "VERSION=${VERSION}" >> $GITHUB_ENV |
| 77 | + echo "PKG_NAME=${PACKAGE_NAME}" >> $GITHUB_ENV |
| 78 | + - run: cat ./PKGBUILD |
| 79 | + - name: Create AUR package |
| 80 | + uses: addnab/docker-run-action@v3 |
| 81 | + with: |
| 82 | + registry: ghcr.io |
| 83 | + image: 'ghcr.io/heyhusen/archlinux-package-action:latest' |
| 84 | + options: -v ${{ github.workspace }}:/workspace --entrypoint="" |
| 85 | + run: /workspace/scripts/ci/entry_point.sh |
| 86 | + - name: Publish AUR package |
| 87 | + uses: KSXGitHub/github-actions-deploy-aur@v3 |
| 88 | + with: |
| 89 | + pkgname: ${{ env.PKG_NAME }} |
| 90 | + pkgbuild: ./PKGBUILD |
| 91 | + commit_username: 'Github automation' |
| 92 | + commit_email: 'noreply@turingpi.com' |
| 93 | + ssh_private_key: ${{ secrets.AUR_DEPLOY_KEY }} |
| 94 | + commit_message: Update package to ${{ env.VERSION }} |
0 commit comments