generated from UniDash-Linux/pkg-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch testing chanel to nightly (#5)
* feat: add build test * fix: dependencies * fix: duplicate import
- Loading branch information
Showing
4 changed files
with
115 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
on: | ||
push: | ||
branches: | ||
- testing | ||
|
||
jobs: | ||
auto_ralease: | ||
name: auto create and push release | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: cachix/install-nix-action@v27 | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@master | ||
with: | ||
ref: testing | ||
|
||
- name: Generate Release version from date | ||
id: date | ||
run: | | ||
TAG_NAME="testing-$(date +'%Y.%m.%d-%H.%M.%S')" | ||
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV | ||
echo "Tag name will be: $TAG_NAME" | ||
- name: Generate tar.gz from src | ||
id: generate_tar | ||
run: | | ||
PKG_NAME="$(basename "${{ github.repository }}" | sed 's/pkg-//g')" | ||
FILE_NAME="src-${PKG_NAME}.tar.gz" | ||
echo "PKG_NAME=$PKG_NAME" >> $GITHUB_ENV | ||
echo "FILE_NAME=$FILE_NAME" >> $GITHUB_ENV | ||
tar -czvf ${FILE_NAME} src/ | ||
FILE_HASH=$(sha256sum ${FILE_NAME} | cut -d ' ' -f 1) | ||
echo "FILE_HASH=$FILE_HASH" >> $GITHUB_ENV | ||
- name: Generate package.nix | ||
id: generate_package | ||
run: | | ||
URL=$(echo \ | ||
"https://github.com/${{ github.repository }}/releases/download/${{ env.TAG_NAME }}/${{ env.FILE_NAME }}" \ | ||
| sed 's/\//\\\//g' | ||
) | ||
SRC="src = fetchurl {\n url = \"${URL}\";\n sha256 = \"${{ env.FILE_HASH }}\";\n }" | ||
sed -i "s/src = .\/src/src = .\/${{ env.FILE_NAME }}/g" ./package.nix | ||
git add ./${{ env.FILE_NAME }} | ||
nix build | ||
git reset ./${{ env.FILE_NAME }} | ||
sed -i "s/src = .\/${{ env.FILE_NAME }}/${SRC}/g" ./package.nix | ||
sed -i "s/version = \".*\";/version = \"${{ env.TAG_NAME }}\";/g" ./package.nix | ||
- name: Create Release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
name: ${{ env.TAG_NAME }} | ||
tag_name: ${{ env.TAG_NAME }} | ||
prerelease: true | ||
files: | | ||
./${{ env.FILE_NAME }} | ||
./package.nix | ||
- name: Clone RevoluNixPKGS | ||
uses: actions/checkout@master | ||
with: | ||
ref: testing | ||
repository: RevoluNix/revolunixpkgs | ||
token: ${{ secrets.RevoluNixPKGS_TOKEN }} | ||
|
||
- name: Update RevoluNixPKGS | ||
id: update_pkgs | ||
run: | | ||
git config --global user.email "${{ github.event.pusher.email }}" | ||
git config --global user.name "${{ github.event.pusher.name }}" | ||
URL="https://github.com/${{ github.repository }}/releases/download/${{ env.TAG_NAME }}/package.nix" | ||
rm -rf ./pkgs/${{ env.PKG_NAME }} | ||
mkdir -p ./pkgs/${{ env.PKG_NAME }} | ||
wget -O ./pkgs/${{ env.PKG_NAME }}/package.nix $URL | ||
git add . | ||
git commit -m "feat: Update/Upload ${{ env.PKG_NAME }} package" | ||
- name: Push RevoluNixPKGS changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.RevoluNixPKGS_TOKEN }} | ||
repository: RevoluNix/revolunixpkgs | ||
branch: testing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters