Compare commits

..

51 Commits

Author SHA1 Message Date
Ahmad Husen f710e16a35 Merge pull request #19 from hapakaien/release/v2.1.0
CI / Test (with Dockerfile) (push) Has been cancelled
CI / Publish OCI image (push) Has been cancelled
CI / Test (with prebuilt OCI Image) (push) Has been cancelled
CI / Release (push) Has been cancelled
chore: release v2.1.0
2022-05-05 23:08:55 +07:00
Ahmad Husen 7118f1dd24 chore: release v2.1.0 2022-05-05 23:07:01 +07:00
Ahmad Husen fda333bd87 Merge pull request #18 from kamack38/aur-deps
feat: 🎸 Add option to resolve deps using paru (from AUR)
2022-05-04 19:52:40 +07:00
kamack38 80d76aa524 style: 💄 Fix trailing space in README 2022-04-27 14:12:16 +02:00
kamack38 77f37ad6f1 docs: ✏️ Update docs 2022-04-27 14:10:39 +02:00
kamack38 c3e3ab0325 feat: 🎸 Add option to resolve deps using paru (from AUR) 2022-04-27 14:06:06 +02:00
dependabot[bot] b257397a15 Merge pull request #17 from hapakaien/dependabot/github_actions/actions/checkout-3 2022-03-02 11:24:41 +00:00
dependabot[bot] a4f0a491d0 chore(deps): bump actions/checkout from 2.4.0 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2.4.0 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2.4.0...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-01 20:28:36 +00:00
Ahmad Husen eadb0293c0 Merge pull request #16 from hapakaien/release/v2.0.3
CI / Test (with Dockerfile) (push) Has been cancelled
CI / Publish OCI image (push) Has been cancelled
CI / Test (with prebuilt OCI Image) (push) Has been cancelled
CI / Release (push) Has been cancelled
chore: release v2.0.3
2022-02-02 15:15:02 +07:00
Ahmad Husen 9400d7c75d chore: release v2.0.3 2022-02-02 15:13:33 +07:00
Ahmad Husen c121cf29d7 Merge pull request #15 from hapakaien/bugfix/pkgbuild-permission
fix: wrong copied PKGBUILD permission
2022-02-02 15:09:47 +07:00
Ahmad Husen 265fe9f569 fix: wrong copied PKGBUILD permission 2022-02-02 15:08:12 +07:00
Ahmad Husen 66d669bebf Merge pull request #14 from hapakaien/v2
CI / Publish OCI image (push) Has been cancelled
CI / Test (with prebuilt OCI Image) (push) Has been cancelled
CI / Release (push) Has been cancelled
CI / Test (with Dockerfile) (push) Has been cancelled
chore: release v2.0.2
2022-02-02 12:06:30 +07:00
Ahmad Husen e346bea956 chore: release v2.0.2 2022-02-02 11:43:57 +07:00
Ahmad Husen 6ade55c2b2 Merge pull request #13 from hapakaien/v2
chore: release v2.0.1
2022-02-02 11:36:26 +07:00
Ahmad Husen 8455f15e27 chore: release v2.0.1 2022-02-02 11:34:30 +07:00
Ahmad Husen 594be7f44a Merge pull request #12 from hapakaien/hotfix/wrong-oci-tag
CI / Publish OCI image (push) Has been cancelled
CI / Test (with prebuilt OCI Image) (push) Has been cancelled
CI / Test (with Dockerfile) (push) Has been cancelled
CI / Release (push) Has been cancelled
fix: wrong oci image tag on action.yml
2022-02-02 11:33:13 +07:00
Ahmad Husen 0a161adbcd fix: wrong oci image tag on action.yml 2022-02-02 11:31:39 +07:00
Ahmad Husen 94c0a400c6 Merge pull request #11 from hapakaien/v2
chore: release v2.0.0
2022-02-02 11:21:48 +07:00
Ahmad Husen cd2e2d62b6 chore: release v2.0.0
CI / Publish OCI image (push) Has been cancelled
CI / Test (with Dockerfile) (push) Has been cancelled
CI / Test (with prebuilt OCI Image) (push) Has been cancelled
CI / Release (push) Has been cancelled
2022-02-02 11:19:55 +07:00
Ahmad Husen 4da3a1b0cc Merge pull request #10 from hapakaien/feature/migrate-to-buildah
feature: replace Docker with Buildah in CI
2022-02-02 11:08:06 +07:00
Ahmad Husen 7926f4fb39 feature: replace Docker with Buildah in CI 2022-02-02 11:03:05 +07:00
Ahmad Husen 863b0d9617 Merge pull request #9 from hapakaien/bugfix/sudoers-user
fix: add user directly into sudoers file
2022-02-02 10:39:52 +07:00
Ahmad Husen 360be955b0 fix: add user directly into sudoers file 2022-02-02 10:38:28 +07:00
dependabot[bot] 6443f058c1 Merge pull request #7 from datakrama/dependabot/github_actions/actions/checkout-2.4.0 2021-11-08 12:00:30 +00:00
dependabot[bot] c05034041f chore(deps): bump actions/checkout from 2.3.5 to 2.4.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 2.3.5 to 2.4.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2.3.5...v2.4.0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-02 20:11:55 +00:00
Ahmad Husen d90b1b2689 chore: release v1.1.1
CI / Test (with Dockerfile) (push) Successful in 1m27s
CI / Publish container image (push) Has been cancelled
CI / Test (with prebuilt Container Image) (push) Has been cancelled
CI / Release (push) Has been cancelled
2021-10-26 09:00:00 +07:00
Ahmad Husen 3747c6e38e Merge pull request #6 from datakrama/bugfix/path
fix(bash): .git folder
2021-10-26 08:52:10 +07:00
Ahmad Husen 10816168b7 fix(bash): .git folder 2021-10-26 08:49:09 +07:00
dependabot[bot] 87fb26e440 Merge pull request #5 from datakrama/dependabot/github_actions/actions/checkout-2.3.5 2021-10-26 01:12:05 +00:00
dependabot[bot] 38bb9b95aa chore(deps): bump actions/checkout from 2.3.4 to 2.3.5
Bumps [actions/checkout](https://github.com/actions/checkout) from 2.3.4 to 2.3.5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2.3.4...v2.3.5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-15 20:09:36 +00:00
Ahmad Husen 65444430c4 chore: release v1.1.0
CI / Test (with Dockerfile) (push) Successful in 1m21s
CI / Publish container image (push) Has been cancelled
CI / Test (with prebuilt Container Image) (push) Has been cancelled
CI / Release (push) Has been cancelled
2021-10-02 00:09:27 +07:00
Ahmad Husen b3890e00a5 Merge pull request #4 from datakrama/feature/pkgrel
feat: update pkgrel
2021-10-01 22:58:06 +07:00
Ahmad Husen 3487dc866b feat: update pkgrel 2021-10-01 22:54:16 +07:00
Ahmad Husen 581d4292cc Merge pull request #3 from datakrama/feature/pkgver
feat: update pkgver
2021-10-01 22:34:38 +07:00
Ahmad Husen 4d1983388b feat: update pkgver 2021-10-01 22:27:55 +07:00
Ahmad Husen fb6ab46b3f Merge pull request #2 from datakrama/bugfix/missing-bash-set-e
fix(bash): missing 'set e'
2021-10-01 20:41:08 +07:00
Ahmad Husen 796ddff1d3 chore: change branding color 2021-10-01 14:38:53 +07:00
Ahmad Husen 3d91dafd70 fix(bash): missing 'set e' 2021-10-01 13:58:10 +07:00
Ahmad Husen bc46e9c8d4 ci: update sample PKGBUILD 2021-09-30 17:07:53 +07:00
Ahmad Husen 3aa6342a73 feat(container): copy '.git' folder from WORKPATH
CI / Pretest (with Dockerfile) (push) Successful in 1m48s
CI / Test (with pre-built Container Image) (push) Has been cancelled
CI / Publish container image (push) Has been cancelled
2021-05-30 14:24:17 +07:00
Ahmad Husen 8987dba528 feat(container): always under 2021-05-30 14:20:58 +07:00
Ahmad Husen b8114f2ee3 feat(container): change value 2021-05-30 14:14:59 +07:00
Ahmad Husen 42c6bfae1e feat(container): create /tmp folder manually 2021-05-30 14:07:35 +07:00
Ahmad Husen fcedc2d02c feat(container): copy .git to /tmp folder 2021-05-30 14:05:13 +07:00
Ahmad Husen 7f32fc286b feat(container): only copy needed files 2021-05-30 14:00:48 +07:00
Ahmad Husen ec0ee87e6a feat(bash): run all commmand with non-root user 2021-05-30 13:52:20 +07:00
Ahmad Husen 3c654a34ce fix(container): unknown rsync option 2021-05-30 13:38:37 +07:00
Ahmad Husen 65e9437ece feat(container): use rsync instead cp 2021-05-30 13:36:39 +07:00
Ahmad Husen 0593cc597c fix(bash): cp permission 2021-05-30 13:26:06 +07:00
Ahmad Husen 88a8c57641 feat(bash): copying files to /tmp instead of chown 2021-05-30 13:19:29 +07:00
6 changed files with 269 additions and 71 deletions
+72 -30
View File
@@ -12,12 +12,12 @@ on:
jobs: jobs:
pretest: pretest:
name: Pretest (with Dockerfile) name: Test (with Dockerfile)
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2.3.4 uses: actions/checkout@v3
- name: Update action.yml to build locally - name: Update action.yml to build locally
run: | run: |
@@ -25,11 +25,13 @@ jobs:
cat action.yml cat action.yml
- name: Get sample PKGBUILD - name: Get sample PKGBUILD
run: wget https://github.com/official-human/nonicons-font/raw/main/PKGBUILD run: wget https://github.com/hapakaien/plenti-bin/raw/f5ffaaee02a2119aa16f6b7a27e87e198e096b47/PKGBUILD
- name: Running tests - name: Running test
uses: ./ uses: ./
with: with:
pkgver: '0.4.26'
pkgrel: 2
updpkgsums: true updpkgsums: true
srcinfo: true srcinfo: true
@@ -40,17 +42,24 @@ jobs:
git diff .SRCINFO git diff .SRCINFO
publish: publish:
name: Publish container image name: Publish OCI image
needs: pretest needs: pretest
if: github.event_name != 'pull_request' if: github.event_name != 'pull_request'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: OCI meta - name: Log in to ghcr.io
id: meta uses: redhat-actions/podman-login@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: OCI metadata
id: metadata
uses: docker/metadata-action@v3 uses: docker/metadata-action@v3
with: with:
images: ghcr.io/${{ github.repository }} images: ghcr.io/${{ github.repository }}
@@ -62,38 +71,37 @@ jobs:
type=semver,pattern={{major}} type=semver,pattern={{major}}
type=sha type=sha
- name: Set up QEMU - name: Build image
uses: docker/setup-qemu-action@v1 id: build
uses: redhat-actions/buildah-build@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GHCR
uses: docker/login-action@v1
with: with:
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
containerfiles: |
./Dockerfile
extra-args: |
--pull
- name: Push to ghcr.io
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build.outputs.image }}
tags: ${{ steps.build.outputs.tags }}
registry: ghcr.io registry: ghcr.io
username: ${{ github.repository_owner }} extra-args: |
password: ${{ secrets.GITHUB_TOKEN }} --disable-content-trust
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
test: test:
name: Test (with pre-built Container Image) name: Test (with prebuilt OCI Image)
needs: publish needs: publish
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2.3.4 uses: actions/checkout@v3
- name: Get sample PKGBUILD - name: Get sample PKGBUILD
run: wget https://github.com/official-human/nonicons-font/raw/main/PKGBUILD run: wget https://github.com/hapakaien/plenti-bin/raw/f5ffaaee02a2119aa16f6b7a27e87e198e096b47/PKGBUILD
- name: Update action.yml to use edge tagged container image - name: Update action.yml to use edge tagged container image
if: github.ref == 'refs/heads/main' if: github.ref == 'refs/heads/main'
@@ -101,9 +109,11 @@ jobs:
sed -i 's/.*image\:.*/ image\: \"docker\:\/\/ghcr.io\/${{ github.repository_owner }}\/${{ github.event.repository.name }}\:edge\"/' action.yml sed -i 's/.*image\:.*/ image\: \"docker\:\/\/ghcr.io\/${{ github.repository_owner }}\/${{ github.event.repository.name }}\:edge\"/' action.yml
cat action.yml cat action.yml
- name: Running tests - name: Running test
uses: ./ uses: ./
with: with:
pkgver: '0.4.26'
pkgrel: 2
updpkgsums: true updpkgsums: true
srcinfo: true srcinfo: true
@@ -112,3 +122,35 @@ jobs:
ls -la ls -la
git diff PKGBUILD git diff PKGBUILD
git diff .SRCINFO git diff .SRCINFO
release:
name: Release
runs-on: ubuntu-latest
needs: test
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get branch/tag names
id: branch-name
uses: tj-actions/branch-names@v5
with:
strip_tag_prefix: "v"
- name: Read changelog
id: changelog-reader
uses: mindsers/changelog-reader-action@v2
with:
version: ${{ steps.branch-name.outputs.tag }}
path: ./CHANGELOG.md
- name: Create/update release
uses: ncipollo/release-action@v1
with:
tag: v${{ steps.branch-name.outputs.tag }}
name: v${{ steps.branch-name.outputs.tag }}
body: ${{ steps.changelog-reader.outputs.changes }}
allowUpdates: true
token: ${{ secrets.GITHUB_TOKEN }}
+99
View File
@@ -0,0 +1,99 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [2.1.0] - 2022-05-05
### Added
- Option to resolve deps using paru (from AUR)
## [2.0.3] - 2022-02-02
### Fixed
- Copied PKGBUILD file has wrong permission
## [2.0.2] - 2022-02-02
### Fixed
- CI can not read changelog
## [2.0.1] - 2022-02-02
### Fixed
- Wrong OCI image tag at action.yml
## [2.0.0] - 2022-02-02
### Changed
- Move repo from hapakaien to hapakaien
- `builder` user is added to sudoers directly instead of via the wheel group
- Replace Docker with Buildah in CI
### Fixed
- `builder` is not in the sudoers file
## [1.1.1] - 2021-10-26
### Fixed
- Wrong `.git` folder when using `path` parameter
## [1.1.0] - 2021-10-02
### Added
- Update `pkgver` on PKGBUILD
- Update `pkgrel` on PKGBUILD
### Fixed
- Missing `set -e` on bash
## [1.0.3] - 2021-05-30
### Fixed
- $GITHUB_WORKSPACE permission in step after using this action
## [1.0.2] - 2021-05-26
### Fixed
- Docker runner syntax
- Path sntax
## [1.0.1] - 2021-05-19
### Fixed
- Missing documentation
## [1.0.0] - 2021-05-19
### Added
- Initial release
[Unreleased]: https://github.com/hapakaien/archlinux-package-action/compare/v2.1.0...HEAD
[2.1.0]: https://github.com/hapakaien/archlinux-package-action/compare/v2.0.3...v2.1.0
[2.0.3]: https://github.com/hapakaien/archlinux-package-action/compare/v2.0.2...v2.0.3
[2.0.2]: https://github.com/hapakaien/archlinux-package-action/compare/v2.0.1...v2.0.2
[2.0.1]: https://github.com/hapakaien/archlinux-package-action/compare/v2.0.0...v2.0.1
[2.0.0]: https://github.com/hapakaien/archlinux-package-action/compare/v1.1.1...v2.0.0
[1.1.1]: https://github.com/hapakaien/archlinux-package-action/compare/v1.1.0...v1.1.1
[1.1.0]: https://github.com/hapakaien/archlinux-package-action/compare/v1.0.3...v1.1.0
[1.0.3]: https://github.com/hapakaien/archlinux-package-action/compare/v1.0.2...v1.0.3
[1.0.2]: https://github.com/hapakaien/archlinux-package-action/compare/v1.0.1...v1.0.2
[1.0.1]: https://github.com/hapakaien/archlinux-package-action/compare/v1.0.0...v1.0.1
[1.0.0]: https://github.com/hapakaien/archlinux-package-action/releases/tag/v1.0.0
+8 -5
View File
@@ -5,11 +5,14 @@ FROM docker.io/library/archlinux:base-devel
RUN pacman -Syu --needed --noconfirm pacman-contrib namcap git RUN pacman -Syu --needed --noconfirm pacman-contrib namcap git
# Setup user # Setup user
RUN useradd --create-home --shell /bin/bash builder && \ RUN useradd -m builder && \
passwd --delete builder && \ echo 'builder ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
chown -vR builder:builder /home/builder && \ WORKDIR /home/builder
usermod -aG wheel builder && \ USER builder
echo 'wheel ALL=(ALL:ALL) ALL' >> /etc/sudoers
# Install paru
RUN git clone https://aur.archlinux.org/paru-bin.git
RUN cd paru-bin && makepkg -si --noconfirm
# Copy files # Copy files
COPY LICENSE README.md / COPY LICENSE README.md /
+13 -10
View File
@@ -1,13 +1,13 @@
# Arch Linux's package tools action # Arch Linux's package tools action
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/datakrama/archlinux-package-action/CI?label=CI&style=flat-square)](https://github.com/datakrama/archlinux-package-action/actions) [![GitHub release (latest by date)](https://img.shields.io/github/v/release/datakrama/archlinux-package-action?style=flat-square)](https://github.com/datakrama/archlinux-package-action/releases) [![GitHub](https://img.shields.io/github/license/datakrama/archlinux-package-action?style=flat-square)](./LICENSE) [![GitHub Workflow Status](https://img.shields.io/github/workflow/status/hapakaien/archlinux-package-action/CI?label=CI&style=flat-square)](https://github.com/hapakaien/archlinux-package-action/actions) [![GitHub release (latest by date)](https://img.shields.io/github/v/release/hapakaien/archlinux-package-action?style=flat-square)](https://github.com/hapakaien/archlinux-package-action/releases) [![GitHub](https://img.shields.io/github/license/hapakaien/archlinux-package-action?style=flat-square)](./LICENSE)
This action allows running tools needed for creating Arch Linux (and AUR) package. This action allows running tools needed for creating Arch Linux (and AUR) package.
Here's what this action can do: Here's what this action can do:
- Update checksums on PKGBUILD file - Update `pkgver`, `pkgrel`, or checksums on PKGBUILD file
- Generate [.SRCINFO](https://wiki.archlinux.org/title/.SRCINFO) based on your PKGBUILD
- Validate PKGBUILD with [namcap](https://wiki.archlinux.org/title/namcap) - Validate PKGBUILD with [namcap](https://wiki.archlinux.org/title/namcap)
- Generate [.SRCINFO](https://wiki.archlinux.org/title/.SRCINFO) based on your PKGBUILD
- Run [makepkg](https://wiki.archlinux.org/title/Makepkg) with custom flags (rather than default) - Run [makepkg](https://wiki.archlinux.org/title/Makepkg) with custom flags (rather than default)
## Usage ## Usage
@@ -22,12 +22,15 @@ Here's what this action can do:
Following inputs can be used as `step.with` keys Following inputs can be used as `step.with` keys
| Name | Type | Default | Required | Description | | Name | Type | Default | Required | Description |
|-------------------|-----------|-------------------------------|-----------|---------------------------------------| | ------------ | ------- | ------------------ | -------- | -------------------------------------------------------------------------------- |
| `path` | String | | `false` | Path where PKGBUILD is located. This path always located under $GITHUB_WORKSPACE | | `path` | String | | `false` | Path where PKGBUILD is located. This path always located under $GITHUB_WORKSPACE |
| `pkgver` | String | | `false` | Update `pkgver` on your PKGBUILD |
| `pkgrel` | Integer | | `false` | Update `pkgrel` on your PKGBUILD |
| `updpkgsums` | Boolean | `false` | `false` | Update checksums on your PKGBUILD | | `updpkgsums` | Boolean | `false` | `false` | Update checksums on your PKGBUILD |
| `srcinfo` | Boolean | `false` | `false` | Generate new .SRCINFO | | `srcinfo` | Boolean | `false` | `false` | Generate new .SRCINFO |
| `namcap` | Boolean | `true` | `false` | Validate PKGBUILD | | `namcap` | Boolean | `true` | `false` | Validate PKGBUILD |
| `flags` | String | `-cfs --noconfirm` | `false` | Flags after `makepkg` command. Leave this empty will disable this command. | | `flags` | String | `-cfs --noconfirm` | `false` | Flags after `makepkg` command. Leave this empty will disable this command. |
| `aur` | Boolean | `false` | `false` | Resolve dependencies using paru |
### Examples ### Examples
@@ -50,7 +53,7 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Validate package - name: Validate package
uses: datakrama/archlinux-package-action@v1 uses: hapakaien/archlinux-package-action@v2
``` ```
#### 2. Only generate .SRCINFO #### 2. Only generate .SRCINFO
@@ -70,7 +73,7 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Validate package - name: Validate package
uses: datakrama/archlinux-package-action@v1 uses: hapakaien/archlinux-package-action@v2
with: with:
flags: '' flags: ''
namcap: false namcap: false
@@ -94,7 +97,7 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Validate package - name: Validate package
uses: datakrama/archlinux-package-action@v1 uses: hapakaien/archlinux-package-action@v2
with: with:
flags: '' flags: ''
namcap: false namcap: false
@@ -118,13 +121,13 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Validate package - name: Validate package
uses: datakrama/archlinux-package-action@v1 uses: hapakaien/archlinux-package-action@v2
with: with:
path: $GITHUB_WORKSPACE/package path: package
flags: '-si --noconfirm' flags: '-si --noconfirm'
namcap: false namcap: false
``` ```
## License ## License
The scripts and documentation in this project are released under the [MIT License](./LICENSE) The scripts and documentation in this project are released under the [MIT License](LICENSE)
+18 -3
View File
@@ -1,16 +1,24 @@
# https://help.github.com/en/articles/metadata-syntax-for-github-actions # https://help.github.com/en/articles/metadata-syntax-for-github-actions
name: "Arch Linux's package action" name: "Arch Linux's package action"
description: "GitHub Action to run Arch Linux's package tools" description: "GitHub Action to run Arch Linux's package tools"
author: 'datakrama' author: 'hapakaien'
branding: branding:
icon: 'package' icon: 'package'
color: 'green' color: 'blue'
inputs: inputs:
path: path:
description: 'Location for this action to run' description: 'Location for this action to run'
default: '' default: ''
required: false required: false
pkgver:
description: 'Update pkgver on PKGBUILD'
default: ''
required: false
pkgrel:
description: 'Update pkgrel on PKGBUILD'
default: ''
required: false
updpkgsums: updpkgsums:
description: 'Update checksums on PKGBUILD' description: 'Update checksums on PKGBUILD'
default: 'false' default: 'false'
@@ -27,13 +35,20 @@ inputs:
description: 'Validate package with namcap' description: 'Validate package with namcap'
default: 'true' default: 'true'
required: false required: false
aur:
description: 'Resolve dependencies using paru'
default: 'false'
required: false
runs: runs:
using: 'docker' using: 'docker'
image: 'docker://ghcr.io/datakrama/archlinux-package-action:1' image: 'docker://ghcr.io/hapakaien/archlinux-package-action:2'
args: args:
- ${{ inputs.path }} - ${{ inputs.path }}
- ${{ inputs.pkgver }}
- ${{ inputs.pkgrel }}
- ${{ inputs.updpkgsums }} - ${{ inputs.updpkgsums }}
- ${{ inputs.srcinfo }} - ${{ inputs.srcinfo }}
- ${{ inputs.flags }} - ${{ inputs.flags }}
- ${{ inputs.namcap }} - ${{ inputs.namcap }}
- ${{ inputs.aur }}
+52 -16
View File
@@ -1,39 +1,75 @@
#!/bin/bash #!/bin/bash
set -e
# Set path # Set path
echo '::group::Configuring path with permission'
WORKPATH=$GITHUB_WORKSPACE/$INPUT_PATH WORKPATH=$GITHUB_WORKSPACE/$INPUT_PATH
HOME=/home/builder
echo "::group::Copying files from $WORKPATH to $HOME/gh-action"
# Set path permision # Set path permision
sudo chown -R builder $WORKPATH cd $HOME
cd $WORKPATH mkdir gh-action
echo '::endgroup::' cd gh-action
cp -rfv "$GITHUB_WORKSPACE"/.git ./
cp -fv "$WORKPATH"/PKGBUILD ./
echo "::endgroup::"
# Update pkgver
if [[ -n $INPUT_PKGVER ]]; then
echo "::group::Updating pkgver on PKGBUILD"
sed -i "s:^pkgver=.*$:pkgver=$INPUT_PKGVER:g" PKGBUILD
git diff PKGBUILD
echo "::endgroup::"
fi
# Update pkgver
if [[ -n $INPUT_PKGREL ]]; then
echo "::group::Updating pkgrel on PKGBUILD"
sed -i "s:^pkgrel=.*$:pkgrel=$INPUT_PKGREL:g" PKGBUILD
git diff PKGBUILD
echo "::endgroup::"
fi
# Update checksums # Update checksums
echo '::group::Updating checksums on PKGBUILD'
if [[ $INPUT_UPDPKGSUMS == true ]]; then if [[ $INPUT_UPDPKGSUMS == true ]]; then
sudo -u builder updpkgsums echo "::group::Updating checksums on PKGBUILD"
updpkgsums
git diff PKGBUILD git diff PKGBUILD
echo "::endgroup::"
fi fi
echo '::endgroup::'
# Generate .SRCINFO # Generate .SRCINFO
echo '::group::Generating new .SRCINFO based on PKGBUILD'
if [[ $INPUT_SRCINFO == true ]]; then if [[ $INPUT_SRCINFO == true ]]; then
sudo -u builder makepkg --printsrcinfo > .SRCINFO echo "::group::Generating new .SRCINFO based on PKGBUILD"
makepkg --printsrcinfo >.SRCINFO
git diff .SRCINFO git diff .SRCINFO
echo "::endgroup::"
fi fi
echo '::endgroup::'
# Validate with namcap # Validate with namcap
echo '::group::Validating PKGBUILD with namcap'
if [[ $INPUT_NAMCAP == true ]]; then if [[ $INPUT_NAMCAP == true ]]; then
echo "::group::Validating PKGBUILD with namcap"
namcap -i PKGBUILD namcap -i PKGBUILD
echo "::endgroup::"
fi
# Install depends using paru from aur
if [[ -n $INPUT_AUR ]]; then
echo "::group::Installing depends using paru"
source PKGBUILD
paru -Syu --removemake --needed --noconfirm "${depends[@]}" "${makedepends[@]}"
echo "::endgroup::"
fi fi
echo '::endgroup::'
# Run makepkg # Run makepkg
echo '::group::Running makepkg with flags' if [[ -n $INPUT_FLAGS ]]; then
if [[ -n "$INPUT_FLAGS" ]]; then echo "::group::Running makepkg with flags"
sudo -u builder makepkg $INPUT_FLAGS makepkg $INPUT_FLAGS
echo "::endgroup::"
fi fi
echo '::endgroup::'
echo "::group::Copying files from $HOME/gh-action to $WORKPATH"
sudo cp -fv PKGBUILD "$WORKPATH"/PKGBUILD
if [[ -e .SRCINFO ]]; then
sudo cp -fv .SRCINFO "$WORKPATH"/.SRCINFO
fi
echo "::endgroup::"