Skip to content

Commit

Permalink
CI: Create nightly releases
Browse files Browse the repository at this point in the history
  • Loading branch information
syyyr committed Dec 23, 2024
1 parent b128eb3 commit a265b5d
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,46 @@ jobs:
with:
name: ${{ matrix.os }}-${{ matrix.toolchain }}-binary
path: ${{github.workspace}}/install/bin

create-nightly-release:
name: Create nightly
#if: github.ref == 'refs/heads/master'
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Consolidate artifacts
uses: actions/download-artifact@v4
with:
pattern: '*-latest-nightly-binary'
merge-multiple: true

- name: Rename artifacts
run: |
LIBSHV_GIT_HASH="$(printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)")"
mv cp2cp "cp2cp-${LIBSHV_GIT_HASH}"
mv cp2cp.exe "cp2cp-${LIBSHV_GIT_HASH}.exe"
- name: Remove previous Nightly assets
run: |
readarray -t PREVIOUS_ASSETS < <(gh release view nightly --json assets --jq .assets[].name)
for PREVIOUS_ASSET in "${PREVIOUS_ASSETS[@]}"; do
gh release delete-asset nightly "${PREVIOUS_ASSET}" --yes
done
env:
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Release
uses: softprops/action-gh-release@v2
with:
name: Nightly
tag_name: nightly
fail_on_unmatched_files: true
body: |
The latest and greatest.
This is a nightly release. If you find any bugs, please report them to the repository's issue tracker.
files: |
cp2cp*

0 comments on commit a265b5d

Please sign in to comment.