Compare commits
25 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d90b1b2689 | |||
| 3747c6e38e | |||
| 10816168b7 | |||
| 87fb26e440 | |||
| 38bb9b95aa | |||
| 65444430c4 | |||
| b3890e00a5 | |||
| 3487dc866b | |||
| 581d4292cc | |||
| 4d1983388b | |||
| fb6ab46b3f | |||
| 796ddff1d3 | |||
| 3d91dafd70 | |||
| bc46e9c8d4 | |||
| 3aa6342a73 | |||
| 8987dba528 | |||
| b8114f2ee3 | |||
| 42c6bfae1e | |||
| fcedc2d02c | |||
| 7f32fc286b | |||
| ec0ee87e6a | |||
| 3c654a34ce | |||
| 65e9437ece | |||
| 0593cc597c | |||
| 88a8c57641 |
@@ -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@v2.3.5
|
||||||
|
|
||||||
- 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/datakrama/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
|
||||||
|
|
||||||
@@ -47,7 +49,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2.3.5
|
||||||
|
|
||||||
- name: OCI meta
|
- name: OCI meta
|
||||||
id: meta
|
id: meta
|
||||||
@@ -84,16 +86,16 @@ jobs:
|
|||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
|
||||||
test:
|
test:
|
||||||
name: Test (with pre-built Container Image)
|
name: Test (with prebuilt Container 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@v2.3.5
|
||||||
|
|
||||||
- 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/datakrama/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 +103,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 +116,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@v2.3.5
|
||||||
|
|
||||||
|
- 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 }}
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
# 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]
|
||||||
|
|
||||||
|
## [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/datakrama/archlinux-package-action/compare/v1.1.1...HEAD
|
||||||
|
[1.1.1]: https://github.com/datakrama/archlinux-package-action/compare/v1.1.0...v1.1.1
|
||||||
|
[1.1.0]: https://github.com/datakrama/archlinux-package-action/compare/v1.0.3...v1.1.0
|
||||||
|
[1.0.3]: https://github.com/datakrama/archlinux-package-action/compare/v1.0.2...v1.0.3
|
||||||
|
[1.0.2]: https://github.com/datakrama/archlinux-package-action/compare/v1.0.1...v1.0.2
|
||||||
|
[1.0.1]: https://github.com/datakrama/archlinux-package-action/compare/v1.0.0...v1.0.1
|
||||||
|
[1.0.0]: https://github.com/datakrama/archlinux-package-action/releases/tag/v1.0.0
|
||||||
@@ -5,9 +5,9 @@
|
|||||||
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
|
||||||
@@ -24,6 +24,8 @@ 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 |
|
||||||
@@ -120,11 +122,11 @@ jobs:
|
|||||||
- name: Validate package
|
- name: Validate package
|
||||||
uses: datakrama/archlinux-package-action@v1
|
uses: datakrama/archlinux-package-action@v1
|
||||||
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)
|
||||||
|
|||||||
+11
-1
@@ -4,13 +4,21 @@ description: "GitHub Action to run Arch Linux's package tools"
|
|||||||
author: 'datakrama'
|
author: 'datakrama'
|
||||||
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'
|
||||||
@@ -33,6 +41,8 @@ runs:
|
|||||||
image: 'docker://ghcr.io/datakrama/archlinux-package-action:1'
|
image: 'docker://ghcr.io/datakrama/archlinux-package-action:1'
|
||||||
args:
|
args:
|
||||||
- ${{ inputs.path }}
|
- ${{ inputs.path }}
|
||||||
|
- ${{ inputs.pkgver }}
|
||||||
|
- ${{ inputs.pkgrel }}
|
||||||
- ${{ inputs.updpkgsums }}
|
- ${{ inputs.updpkgsums }}
|
||||||
- ${{ inputs.srcinfo }}
|
- ${{ inputs.srcinfo }}
|
||||||
- ${{ inputs.flags }}
|
- ${{ inputs.flags }}
|
||||||
|
|||||||
+39
-13
@@ -1,39 +1,65 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
# Set path
|
# Set path
|
||||||
echo '::group::Configuring path with permission'
|
echo "::group::Copying file from $WORKPATH to /tmp/gh-action"
|
||||||
WORKPATH=$GITHUB_WORKSPACE/$INPUT_PATH
|
WORKPATH=$GITHUB_WORKSPACE/$INPUT_PATH
|
||||||
# Set path permision
|
# Set path permision
|
||||||
sudo chown -R builder $WORKPATH
|
sudo -u builder mkdir /tmp/gh-action
|
||||||
cd $WORKPATH
|
sudo -u builder cp -rfv "$GITHUB_WORKSPACE"/.git /tmp/gh-action/.git
|
||||||
echo '::endgroup::'
|
sudo -u builder cp -fv "$WORKPATH"/PKGBUILD /tmp/gh-action/PKGBUILD
|
||||||
|
cd /tmp/gh-action
|
||||||
|
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
|
||||||
|
echo "::group::Updating checksums on PKGBUILD"
|
||||||
sudo -u builder updpkgsums
|
sudo -u builder 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
|
||||||
|
echo "::group::Generating new .SRCINFO based on PKGBUILD"
|
||||||
sudo -u builder makepkg --printsrcinfo > .SRCINFO
|
sudo -u builder 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
|
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
|
sudo -u builder makepkg $INPUT_FLAGS
|
||||||
|
echo "::endgroup::"
|
||||||
fi
|
fi
|
||||||
echo '::endgroup::'
|
|
||||||
|
echo "::group::Copying files from /tmp/gh-action to $WORKPATH"
|
||||||
|
cp -fv /tmp/gh-action/PKGBUILD "$WORKPATH"/PKGBUILD
|
||||||
|
if [[ -e /tmp/gh-action/.SRCINFO ]]; then
|
||||||
|
cp -fv /tmp/gh-action/.SRCINFO "$WORKPATH"/.SRCINFO
|
||||||
|
fi
|
||||||
|
echo "::endgroup::"
|
||||||
|
|||||||
Reference in New Issue
Block a user