diff --git a/.aur/PKGBUILD b/.aur/PKGBUILD new file mode 100644 index 0000000..40735d9 --- /dev/null +++ b/.aur/PKGBUILD @@ -0,0 +1,42 @@ +# Maintainer: {{AUTHOR}} <{{EMAIL}}> + +pkgname={{NAME}} +pkgver={{VERSION}} +pkgrel=1 +pkgdesc="{{DESC}}" +arch=('x86_64' 'aarch64' 'armv7') +url={{URL}} +license=('GPL') +provides=($pkgname) +conflicts=($pkgname) + +source_x86_64=( + "$url/releases/download/$pkgver/$pkgname-$pkgver-x86_64-unknown-linux-gnu.tar.gz" +) +md5sums_x86_64=(SKIP) + +source_armv7=( + "$url/releases/download/$pkgver/$pkgname-$pkgver-armv7-unknown-linux-gnueabihf.tar.gz" +) +md5sums_armv7=(SKIP) + +source_aarch64=( + "$url/releases/download/$pkgver/$pkgname-$pkgver-aarch64-unknown-linux-gnu.tar.gz" +) +md5sums_aarch64=(SKIP) + +package() { + case $CARCH in + x86_64 ) + _output="$pkgname-$pkgver-x86_64-unknown-linux-gnu" + ;; + armv7 ) + _output="$pkgname-$pkgver-armv7-unknown-linux-gnueabihf" + ;; + aarch64 ) + _output="$pkgname-$pkgver-aarch64-unknown-linux-gnu" + ;; + esac + + install -Dm755 "${srcdir}/${_output}/${pkgname}" "${pkgdir}/usr/bin/${pkgname}" +} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4ff22c3..31c446a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,7 +49,8 @@ jobs: PKG_NAME: ${{ steps.vars.outputs.PKG_NAME }} PKG_VERSION: ${{ steps.vars.outputs.PKG_VERSION }} PKG_DESC: ${{ steps.vars.outputs.PKG_DESC }} - PKG_AUTHORS: ${{ steps.vars.outputs.PKG_AUTHORS }} + PKG_AUTHOR: ${{ steps.vars.outputs.PKG_AUTHOR }} + PKG_EMAIL: ${{ steps.vars.outputs.PKG_EMAIL }} PKG_HOMEPAGE: ${{ steps.vars.outputs.PKG_HOMEPAGE }} steps: - name: Git Checkout @@ -76,7 +77,8 @@ jobs: echo ::set-output name=PKG_NAME::${PKG_NAME} echo ::set-output name=PKG_BASENAME::${PKG_BASENAME} echo ::set-output name=PKG_DESC::${PKG_DESC} - echo ::set-output name=PKG_AUTHORS::${PKG_AUTHORS} + echo ::set-output name=PKG_AUTHOR::$(echo $PKG_AUTHORS | awk '{print $1}') + echo ::set-output name=PKG_EMAIL::$(echo $PKG_AUTHORS | awk '{print $2}' | sed -e 's/[<>]//g') echo ::set-output name=PKG_HOMEPAGE::${PKG_HOMEPAGE} - name: Install Rust toolchain @@ -170,33 +172,33 @@ jobs: command: publish args: --verbose --all-features --token ${{ secrets.CARGO_TOKEN }} - # publish_aur_package: - # name: Publish AUR package - # runs-on: ubuntu-latest - # timeout-minutes: 20 - # if: startsWith(github.ref, 'refs/tags/') - # needs: build - # steps: - # - uses: actions/checkout@v2 - # - # - name: Generate PKGBUILD - # id: gen_pkgbuild - # shell: bash - # run: | - # sed -i -e "s%{{AUTHOR}}%${AUTHOR}%g;" ./.aur/PKGBUILD - # sed -i -e "s%{{EMAIL}}%${EMAIL}%g;" ./.aur/PKGBUILD - # sed -i -e "s%{{NAME}}%${PROJECT_NAME}%g;" ./.aur/PKGBUILD - # sed -i -e "s%{{DESC}}%${PROJECT_DESC}%g;" ./.aur/PKGBUILD - # sed -i -e "s%{{VERSION}}%${VERSION}%g;" ./.aur/PKGBUILD - # sed -i -e "s%{{URL}}%${URL}%g;" ./.aur/PKGBUILD - # cat ./.aur/PKGBUILD - # - # - name: Publish to the AUR - # uses: KSXGitHub/github-actions-deploy-aur@v2 - # with: - # pkgname: ${{ env.PROJECT_NAME }} - # pkgbuild: ./.aur/PKGBUILD - # commit_username: ${{ env.AUTHOR }} - # commit_email: ${{ env.EMAIL }} - # commit_message: ${{ steps.gen_pkgbuild.outputs.VERSION }} - # ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} + publish_aur_package: + name: Publish AUR package + runs-on: ubuntu-latest + timeout-minutes: 20 + if: startsWith(github.ref, 'refs/tags/') + needs: build + steps: + - uses: actions/checkout@v2 + + - name: Generate PKGBUILD + id: gen_pkgbuild + shell: bash + run: | + sed -i -e "s%{{AUTHOR}}%${{needs.build.outputs.PKG_AUTHOR}}%g;" ./.aur/PKGBUILD + sed -i -e "s%{{EMAIL}}%${{needs.build.outputs.PKG_EMAIL}}%g;" ./.aur/PKGBUILD + sed -i -e "s%{{NAME}}%${{needs.build.outputs.PKG_NAME}}%g;" ./.aur/PKGBUILD + sed -i -e "s%{{DESC}}%${{needs.build.outputs.PKG_DESC}}%g;" ./.aur/PKGBUILD + sed -i -e "s%{{VERSION}}%${{needs.build.outputs.PKG_VERSION}}%g;" ./.aur/PKGBUILD + sed -i -e "s%{{URL}}%${{needs.build.outputs.PKG_HOMEPAGE}}%g;" ./.aur/PKGBUILD + cat ./.aur/PKGBUILD + + - name: Publish to the AUR + uses: KSXGitHub/github-actions-deploy-aur@v2.2.5 + with: + pkgbuild: ./.aur/PKGBUILD + pkgname: ${{ needs.build.outputs.PKG_NAME }} + commit_username: ${{ needs.build.outputs.PKG_AUTHOR }} + commit_email: ${{ needs.build.outputs.PKG_EMAIL }} + commit_message: ${{ needs.build.outputs.PKG_VERSION }} + ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} diff --git a/Cargo.toml b/Cargo.toml index 9e05e8b..6655c4e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,8 +4,8 @@ version = "0.7.1" description = "Dotenv (.env) loader written in rust" authors = ["numToStr "] edition = "2018" -homepage = "https://github.com/numToStr/zenv/" -repository = "https://github.com/numToStr/zenv/" +homepage = "https://github.com/numToStr/zenv" +repository = "https://github.com/numToStr/zenv" license = "GPL-3.0-or-later" readme = "README.md" keywords = ["env", "environment", "dotenv", "config", "cli"]