Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch testing chanel to nightly #3

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions .github/workflows/auto_nigthly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ jobs:
name: auto create and push release
runs-on: ubuntu-22.04
steps:
- uses: cachix/install-nix-action@v27

- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@master
with:
ref: nightly

- name: Generate Release version from date
id: date
Expand All @@ -21,12 +25,11 @@ jobs:
- name: Generate tar.gz from src
id: generate_tar
run: |
cd ./src/
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} *
tar -czvf ${FILE_NAME} src/
FILE_HASH=$(sha256sum ${FILE_NAME} | cut -d ' ' -f 1)
echo "FILE_HASH=$FILE_HASH" >> $GITHUB_ENV

Expand All @@ -38,7 +41,11 @@ jobs:
| sed 's/\//\\\//g'
)
SRC="src = fetchurl {\n url = \"${URL}\";\n sha256 = \"${{ env.FILE_HASH }}\";\n }"
sed -i "s/src = .\/src/${SRC}/g" ./package.nix
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
sed -i "1s/.*/{\n fetchurl,/" ./package.nix

Expand All @@ -49,7 +56,7 @@ jobs:
tag_name: ${{ env.TAG_NAME }}
prerelease: true
files: |
./src/${{ env.FILE_NAME }}
./${{ env.FILE_NAME }}
./package.nix

- name: Clone RevoluNixPKGS
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/auto_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ jobs:
name: auto create and push release
runs-on: ubuntu-22.04
steps:
- uses: cachix/install-nix-action@v27

- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@master

- name: Generate Release version from date
id: date
Expand All @@ -21,12 +23,11 @@ jobs:
- name: Generate tar.gz from src
id: generate_tar
run: |
cd ./src/
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} *
tar -czvf ${FILE_NAME} src/
FILE_HASH=$(sha256sum ${FILE_NAME} | cut -d ' ' -f 1)
echo "FILE_HASH=$FILE_HASH" >> $GITHUB_ENV

Expand All @@ -38,7 +39,11 @@ jobs:
| sed 's/\//\\\//g'
)
SRC="src = fetchurl {\n url = \"${URL}\";\n sha256 = \"${{ env.FILE_HASH }}\";\n }"
sed -i "s/src = .\/src/${SRC}/g" ./package.nix
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
sed -i "1s/.*/{\n fetchurl,/" ./package.nix

Expand All @@ -49,7 +54,7 @@ jobs:
tag_name: ${{ env.TAG_NAME }}
prerelease: false
files: |
./src/${{ env.FILE_NAME }}
./${{ env.FILE_NAME }}
./package.nix

- name: Clone RevoluNixPKGS
Expand Down
88 changes: 88 additions & 0 deletions .github/workflows/auto_testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
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
sed -i "1s/.*/{\n fetchurl,/" ./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