Skip to content

Commit

Permalink
Build Swift on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
finagolfin committed Apr 7, 2024
1 parent 338f825 commit 2666894
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 304 deletions.
74 changes: 0 additions & 74 deletions .github/workflows/bootstrap_archives.yml

This file was deleted.

33 changes: 0 additions & 33 deletions .github/workflows/command_not_found.yml

This file was deleted.

67 changes: 0 additions & 67 deletions .github/workflows/docker_image.yml

This file was deleted.

48 changes: 0 additions & 48 deletions .github/workflows/package_updates.yml

This file was deleted.

85 changes: 3 additions & 82 deletions .github/workflows/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,9 @@ name: Packages
on:
push:
branches:
- master
- dev
- 'dev/**'
- swift-devel
paths:
- 'packages/**'
- 'root-packages/**'
- 'x11-packages/**'
pull_request:
paths:
- 'packages/**'
- 'root-packages/**'
- 'x11-packages/**'
workflow_dispatch:
inputs:
packages:
description: "A space-separated names of packages selected for rebuilding"
required: true

permissions: {} # none
- 'packages/swift/**'

jobs:
build:
Expand All @@ -30,7 +14,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
target_arch: [aarch64, arm, i686, x86_64]
target_arch: [aarch64, arm, x86_64]
fail-fast: false
steps:
- name: Setup arm and aarch64 CPU emulators
Expand Down Expand Up @@ -259,66 +243,3 @@ jobs:
with:
name: debs-${{ matrix.target_arch }}-${{ github.sha }}
path: ./artifacts

upload:
concurrency: ${{ github.workflow }}
permissions:
contents: read
if: github.event_name != 'pull_request' && github.ref != 'refs/heads/dev' && !startsWith(github.ref, 'refs/heads/dev/')
needs: build
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Get *.deb files
uses: actions/download-artifact@v4
with:
path: ./
- name: Upload to packages.termux.dev
env:
REPOSITORY_URL: https://packages.termux.dev/aptly-api
run: |
GITHUB_SHA=${{ github.sha }}
APTLY_API_AUTH=${{ secrets.APTLY_API_AUTH }}
GPG_PASSPHRASE=${{ secrets.GPG_PASSPHRASE }}
source scripts/aptly_api.sh
for archive in debs-*/debs-{aarch64,arm,i686,x86_64}-${{ github.sha }}.tar; do
tar xf "$archive"
done
for repo in $(jq --raw-output 'del(.pkg_format) | keys | .[]' repo.json); do
export REPOSITORY_NAME=$(jq --raw-output '.["'$repo'"].name' repo.json)
export REPOSITORY_DISTRIBUTION=$(jq --raw-output '.["'$repo'"].distribution' repo.json)
# Upload file to temporary directory.
uploaded_files=false
shopt -s nullglob
if [ -f debs/built_${REPOSITORY_NAME}_packages.txt ]; then
for filename in $(cat debs/built_${REPOSITORY_NAME}_packages.txt | sed -E 's/(..*)/debs\/\1_\*.deb debs\/\1-static_\*.deb/g'); do
if ! aptly_upload_file "$filename"; then
exit 1
fi
uploaded_files=true
done
shopt -u nullglob
# Publishing repository changes.
if [ "$uploaded_files" = "true" ]; then
if ! aptly_add_to_repo; then
exit 1
fi
# Usually temporary directory is deleted automatically, but in certain cases it is left.
aptly_delete_dir
# Final part to make changes appear in web root.
if ! aptly_publish_repo; then
exit 1
fi
fi
fi
done

0 comments on commit 2666894

Please sign in to comment.