Skip to content

Commit

Permalink
prepare ci for binary package
Browse files Browse the repository at this point in the history
  • Loading branch information
hertg committed Nov 28, 2022
1 parent 0595a7b commit 0ba218e
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 51 deletions.
32 changes: 16 additions & 16 deletions .ci/generate-pkgbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ rm ./.pkgbuild/lightdm-theme-neon/PKGBUILD.template


#### lightdm-theme-neon-bin ####
#
# mkdir -p ./.pkgbuild/lightdm-theme-neon-bin
# cp ./.pkg/aur/lightdm-theme-neon-bin/* ./.pkgbuild/lightdm-theme-neon-bin
#
# cat << EOF > ./.pkgbuild/lightdm-theme-neon-bin/PKGBUILD
# # Maintainer: hertg <aur@her.tg>
# # This file is generated automatically
# _version=$version
# _pkgname=lightdm-theme-neon-bin
# _pkgver=$(echo $version | sed 's/\([^-]*-g\)/r\1/;s/-/./g')
# _sha256sum=$checksum
# _source=\${_pkgname}-\${_pkgver}::https://github.com/hertg/lightdm-neon/releases/download/$version/compiled.tar.gz
# EOF
#
# cat ./.pkgbuild/lightdm-theme-neon-bin/PKGBUILD.template >> ./.pkgbuild/lightdm-theme-neon-bin/PKGBUILD
# rm ./.pkgbuild/lightdm-theme-neon-bin/PKGBUILD.template

mkdir -p ./.pkgbuild/lightdm-theme-neon-bin
cp ./.pkg/aur/lightdm-theme-neon-bin/* ./.pkgbuild/lightdm-theme-neon-bin

cat << EOF > ./.pkgbuild/lightdm-theme-neon-bin/PKGBUILD
# Maintainer: hertg <aur@her.tg>
# This file is generated automatically
_version=$version
_pkgname=lightdm-theme-neon-bin
_pkgver=$(echo $version | sed 's/\([^-]*-g\)/r\1/;s/-/./g')
_sha256sum=$checksum
_source=\${_pkgname}-\${_pkgver}::https://github.com/hertg/lightdm-neon/releases/download/$version/build.tar.gz
EOF

cat ./.pkgbuild/lightdm-theme-neon-bin/PKGBUILD.template >> ./.pkgbuild/lightdm-theme-neon-bin/PKGBUILD
rm ./.pkgbuild/lightdm-theme-neon-bin/PKGBUILD.template
26 changes: 13 additions & 13 deletions .github/workflows/aur-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

# - name: Download binary
# uses: actions/download-artifact@v3
# with:
# name: lightdm-theme-neon-amd64
# path: ./download
#
# - name: Export Checksum
# run: echo "SHA256=$(cat ./download/sha256sum.txt | cut -d' ' -f1)" >> $GITHUB_ENV
- name: Download build
uses: actions/download-artifact@v3
with:
name: build.tar.gz
path: ./download

- name: Export Checksum
run: echo "SHA256=$(cat ./download/sha256sum.txt | cut -d' ' -f1)" >> $GITHUB_ENV

- name: Generate PKGBUILDs
run: ./.ci/generate-pkgbuild.sh ${{ inputs.version }} ${{ env.SHA256 }}
Expand All @@ -42,11 +42,11 @@ jobs:
name: lightdm-theme-neon-PKGBUILD
path: ./.pkgbuild/lightdm-theme-neon/*

# - name: Upload lightdm-theme-neon-bin PKGBUILD
# uses: actions/upload-artifact@v3
# with:
# name: lightdm-theme-neon-bin-PKGBUILD
# path: ./.pkgbuild/lightdm-theme-neon-bin/*
- name: Upload lightdm-theme-neon-bin PKGBUILD
uses: actions/upload-artifact@v3
with:
name: lightdm-theme-neon-bin-PKGBUILD
path: ./.pkgbuild/lightdm-theme-neon-bin/*

- name: Publish lightdm-theme-neon
uses: KSXGitHub/github-actions-deploy-aur@v2.5.0
Expand Down
29 changes: 18 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,23 @@ jobs:
# see https://stackoverflow.com/a/71721059/2726733
fetch-depth: 0

- name: Install and Build
run: |
npm install
npm run build
- name: Install
run: npm ci

- name: Build
run: npm run build

- name: Prepare bin directory
run: mkdir -p ./bin

# - name: Create SHA256 Checksum
# run: sha256sum ./bin/${{ env.BINARY_NAME }} > ./bin/sha256sum.txt || exit $?
- name: Package build
run: tar -czvf ./bin/build.tar.gz ./public

# - name: Upload binary
# uses: actions/upload-artifact@v3
# with:
# name: ${{ env.BINARY_NAME }}
# path: ./bin/*
- name: Create SHA256 Checksum
run: sha256sum ./bin/build.tar.gz > ./bin/sha256sum.txt || exit $?

- name: Upload build
uses: actions/upload-artifact@v3
with:
name: ${{ env.BINARY_NAME }}
path: ./bin/*
11 changes: 5 additions & 6 deletions .github/workflows/github-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,19 @@ jobs:
release:
runs-on: ubuntu-latest
name: Release
# name: Release ${{ inputs.binary }}
steps:

- name: Checkout
uses: actions/checkout@v2

# - uses: actions/download-artifact@v3
# with:
# name: ${{ inputs.binary }}
# path: ./download
- uses: actions/download-artifact@v3
with:
name: build.tar.gz
path: ./download

- name: Create Github Release
uses: softprops/action-gh-release@v1
with:
draft: false
# files: download/${{ inputs.binary }}
files: download/build.tar.gz
prerelease: ${{ contains(github.ref, '-rc.') }}
5 changes: 0 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,7 @@ jobs:
release:
name: Github Release
needs: [build, version]
# strategy:
# matrix:
# binary: [ 'egpu-switcher-amd64', 'egpu-switcher-arm64' ]
uses: ./.github/workflows/github-release.yml
# with:
# binary: ${{ matrix.binary }}

aur:
name: Publish to AUR
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
public/assets/
public/bundle.*
/.pkgbuild/
/bin/

.DS_Store

0 comments on commit 0ba218e

Please sign in to comment.