diff --git a/.ci/generate-pkgbuild.sh b/.ci/generate-pkgbuild.sh index 5d83d44..2f9e934 100755 --- a/.ci/generate-pkgbuild.sh +++ b/.ci/generate-pkgbuild.sh @@ -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 -# # 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 +# 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 diff --git a/.github/workflows/aur-release.yml b/.github/workflows/aur-release.yml index 9f16b83..44ad85b 100644 --- a/.github/workflows/aur-release.yml +++ b/.github/workflows/aur-release.yml @@ -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 }} @@ -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 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b613825..4057a9d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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/* diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml index 5d53f0a..ba9bf5c 100644 --- a/.github/workflows/github-release.yml +++ b/.github/workflows/github-release.yml @@ -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.') }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8865915..8bf1c12 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/.gitignore b/.gitignore index 165be6e..0030299 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,6 @@ public/assets/ public/bundle.* /.pkgbuild/ +/bin/ .DS_Store