Nightly Release #464
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
name: Nightly Release | |
on: | |
schedule: | |
- cron: 0 0 * * * | |
push: | |
tags: "*" | |
branches: [ "dev", "main" ] | |
pull_request: | |
branches: [ "dev", "main" ] | |
jobs: | |
get-version: | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.version.outputs.version }} | |
steps: | |
- name: Creating version | |
run: | | |
echo "sha_short=$(echo $GITHUB_SHA | cut -c1-7)" >> "$GITHUB_ENV" | |
echo "branch=$(echo $GITHUB_REF | cut -d'/' -f 3)" >> "$GITHUB_ENV" | |
- id: version | |
run: | | |
echo "version=${{ env.sha_short }}-${{ env.branch }}" >> $GITHUB_OUTPUT | |
delete-drafts: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Delete drafts | |
uses: hugo19941994/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
build: | |
runs-on: ubuntu-latest | |
container: | |
image: archlinux | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Packages | |
run: pacman -Syu git base-devel cmake curl --noconfirm --needed | |
- name: Get submodules | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Clean | |
run: make clean | |
- name: Compile | |
run: make DEBUG=0 | |
- name: Build release | |
run: make dist DEBUG=0 && mv ./TabAUR-*.tar.zst ./tabaur.tar.zst | |
- name: Upload to github artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tabaur | |
path: ./tabaur.tar.zst | |
release: | |
name: Create GitHub Release | |
needs: [build, get-version] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
outputs: | |
release-url: ${{ steps.create-release.outputs.upload_url }} | |
steps: | |
- name: Re-tag nightly | |
uses: dev-drprasad/[email protected] | |
with: | |
tag_name: nightly | |
delete_release: true | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create Release | |
id: create-release | |
uses: actions/create-release@master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: nightly | |
release_name: TabAUR nightly ${{ needs.get-version.outputs.version }} | |
draft: false | |
prerelease: true | |
upload-binaries: | |
name: Upload binaries to Githib relase | |
runs-on: ubuntu-latest | |
needs: [release, get-version] | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: tabaur | |
- uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.release.outputs.release-url }} | |
asset_path: ./tabaur.tar.zst | |
asset_name: TabAUR-nightly-${{ needs.get-version.outputs.version }}.tar.zst | |
asset_content_type: application/tar+zstd |