-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
2,823 additions
and
2,490 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 |
---|---|---|
|
@@ -5,57 +5,57 @@ on: | |
schedule: | ||
- cron: '0 20 * * *' | ||
jobs: | ||
last-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check if the last commit was today | ||
id: check-commit | ||
run: | | ||
LAST_COMMIT_DATE="$(date -u -d \ | ||
$(curl -H "Accept: application/vnd.github.v3+json" \ | ||
"https://api.github.com/repos/aerospike/aerospike-backup-service/commits" | \ | ||
jq -r '.[0].commit.committer.date') "+%Y-%m-%d")" | ||
TODAY="$(date -u +%Y-%m-%d)" | ||
if [ "$LAST_COMMIT_DATE" == "$TODAY" ]; then | ||
echo "commit_today=true" >> "$GITHUB_OUTPUT" | ||
else | ||
echo "commit_today=false" >> "$GITHUB_OUTPUT" | ||
fi | ||
outputs: | ||
commit_today: ${{ steps.check-commit.outputs.commit_today }} | ||
last-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check if the last commit was today | ||
id: check-commit | ||
run: | | ||
LAST_COMMIT_DATE="$(date -u -d \ | ||
$(curl -H "Accept: application/vnd.github.v3+json" \ | ||
"https://api.github.com/repos/aerospike/aerospike-backup-service/commits" | \ | ||
jq -r '.[0].commit.committer.date') "+%Y-%m-%d")" | ||
TODAY="$(date -u +%Y-%m-%d)" | ||
if [ "$LAST_COMMIT_DATE" == "$TODAY" ]; then | ||
echo "commit_today=true" >> "$GITHUB_OUTPUT" | ||
else | ||
echo "commit_today=false" >> "$GITHUB_OUTPUT" | ||
fi | ||
outputs: | ||
commit_today: ${{ steps.check-commit.outputs.commit_today }} | ||
|
||
nightly-build: | ||
needs: last-commit | ||
if: ${{ needs.last-commit.outputs.commit_today == 'true' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.22.5" | ||
- name: Install Dependencies | ||
run: | | ||
go install "github.com/goreleaser/nfpm/v2/cmd/nfpm@latest" | ||
- name: Build Packages | ||
env: | ||
PAT: ${{ secrets.PAT }} | ||
run: | | ||
git config --global url."https://${PAT}:[email protected]/".insteadOf "https://github.com/" | ||
make packages | ||
- name: Find files matching "*.rpm" and "*.deb" | ||
run: | | ||
ASSET_LIST=$(find . -type f \( -name "*.deb" -or -name "*.rpm" \) | tr '\n' ',') | ||
echo "ASSET_LIST=$ASSET_LIST" >> $GITHUB_ENV | ||
- name: Upload Assets | ||
run: | | ||
IFS=',' read -r -a asset_array <<< "$ASSET_LIST" | ||
for file in "${asset_array[@]}"; do | ||
BASENAME="$(basename ${file%.*})" | ||
EXT="${file##*.}" | ||
curl \ | ||
-u${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_TOKEN }} \ | ||
-XPUT "https://aerospike.jfrog.io/artifactory/ecosystem-$EXT-dev-local/${{ github.event.repository.name }}/$(cat VERSION)/"$BASENAME"_$(date +%Y%m%d).$EXT" \ | ||
-T "$file" | ||
done | ||
nightly-build: | ||
needs: last-commit | ||
if: ${{ needs.last-commit.outputs.commit_today == 'true' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.22.5" | ||
- name: Install Dependencies | ||
run: | | ||
go install "github.com/goreleaser/nfpm/v2/cmd/nfpm@latest" | ||
- name: Build Packages | ||
env: | ||
PAT: ${{ secrets.PAT }} | ||
run: | | ||
git config --global url."https://${PAT}:[email protected]/".insteadOf "https://github.com/" | ||
make packages | ||
- name: Find files matching "*.rpm" and "*.deb" | ||
run: | | ||
ASSET_LIST=$(find . -type f \( -name "*.deb" -or -name "*.rpm" \) | tr '\n' ',') | ||
echo "ASSET_LIST=$ASSET_LIST" >> $GITHUB_ENV | ||
- name: Upload Assets | ||
run: | | ||
IFS=',' read -r -a asset_array <<< "$ASSET_LIST" | ||
for file in "${asset_array[@]}"; do | ||
BASENAME="$(basename ${file%.*})" | ||
EXT="${file##*.}" | ||
curl \ | ||
-u${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_TOKEN }} \ | ||
-XPUT "https://aerospike.jfrog.io/artifactory/ecosystem-$EXT-dev-local/${{ github.event.repository.name }}/$(cat VERSION)/"$BASENAME"_$(date +%Y%m%d).$EXT" \ | ||
-T "$file" | ||
done |
Oops, something went wrong.