snapd, tool, github: packaging for Amazon Linux 2023 #30
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build repository | |
on: | |
pull_request: | |
branches: [ "master"] | |
push: | |
branches: [ "master" ] | |
jobs: | |
build-repo-job: | |
strategy: | |
matrix: | |
target: ["amazonlinux:2", "amazonlinux:2023"] | |
include: | |
- target: amazonlinux:2 | |
artifact_name: repo-tarball-amazonlinux-2 | |
- target: amazonlinux:2023 | |
artifact_name: repo-tarball-amazonlinux-2023 | |
runs-on: ubuntu-latest | |
container: ${{ matrix.target }} | |
steps: | |
- name: Install git | |
run: | | |
yum install git -y | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Build RPM packages | |
run: | | |
IN_CONTAINER=1 ./tool build | |
- name: Build repository tarball | |
run: | | |
IN_CONTAINER=1 ./tool createrepo | |
case ${{ matrix.target }} in | |
amazonlinux:2) | |
repo_file=amazon-linux-2-repo.tar.xz | |
;; | |
amazonlinux:2023) | |
repo_file=amazon-linux-2023-repo.tar.xz | |
;; | |
*) | |
echo "unsupported target ${{ matrix.target }}" | |
exit 1 | |
;; | |
esac | |
tar -cJv repo > "$repo_file" | |
- name: Uploading repository tarball | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.artifact_name }} | |
path: "amazon-linux-*-repo*.tar.xz" |