Skip to content

Commit

Permalink
Remove nightly releases (starkware-libs#1315)
Browse files Browse the repository at this point in the history
  • Loading branch information
tarrencev committed Dec 19, 2023
1 parent bc42b8e commit 90fa4f3
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 181 deletions.
14 changes: 0 additions & 14 deletions .github/scripts/create-tag.js

This file was deleted.

15 changes: 0 additions & 15 deletions .github/scripts/move-tag.js

This file was deleted.

39 changes: 0 additions & 39 deletions .github/scripts/prune-prereleases.js

This file was deleted.

6 changes: 0 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ jobs:
image: ghcr.io/dojoengine/dojo-dev:448ffda
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: Swatinem/rust-cache@v2
- run: cargo llvm-cov nextest --all-features --lcov --output-path lcov.info
- uses: codecov/codecov-action@v3
Expand Down Expand Up @@ -84,8 +82,6 @@ jobs:
image: ghcr.io/dojoengine/dojo-dev:448ffda
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: Swatinem/rust-cache@v2
- run: scripts/clippy.sh

Expand All @@ -104,8 +100,6 @@ jobs:
image: ghcr.io/dojoengine/dojo-dev:448ffda
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: Swatinem/rust-cache@v2
- run: >
scripts/docs.sh
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release-dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
- uses: actions/checkout@v3
- run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- run: cargo release version ${{ inputs.version }} --execute --no-confirm && cargo release replace --execute --no-confirm
- id: changelog
uses: mikepenz/release-changelog-builder-action@v4.1.0
- uses: peter-evans/create-pull-request@v5
with:
# We have to use a PAT in order to trigger ci
Expand All @@ -29,3 +31,4 @@ jobs:
branch: prepare-release
base: main
delete-branch: true
body: ${{steps.changelog.outputs.changelog}}
115 changes: 12 additions & 103 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,81 +1,29 @@
name: release

on:
push:
tags:
- "*"
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
pull_request:
types: [closed]
branches:
- main

env:
IS_NIGHTLY: ${{ (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && 'true' || 'false' }}
CARGO_TERM_COLOR: always
RUST_VERSION: 1.70.0
REGISTRY_IMAGE: ghcr.io/${{ github.repository }}

jobs:
prepare:
name: Prepare release
if: github.event.pull_request.merged == true && github.event.pull_request.head.ref == 'prepare-release'
runs-on: ubuntu-latest

outputs:
tag_name: ${{ steps.release_info.outputs.tag_name }}
release_name: ${{ steps.release_info.outputs.release_name }}
changelog: ${{ steps.build_changelog.outputs.changelog }}

steps:
- name: Checkout sources
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Compute release name and tag
- uses: actions/checkout@v3
- name: Get version
id: release_info
run: |
if [[ $IS_NIGHTLY == "true" ]]; then
echo "tag_name=nightly-${GITHUB_SHA}" >> $GITHUB_OUTPUT
echo "release_name=Nightly ($(date '+%Y-%m-%d'))" >> $GITHUB_OUTPUT
else
echo "tag_name=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
echo "release_name=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
fi
- name: Check version
run: |
if [[ $IS_NIGHTLY != "true" ]]; then
cargo install cargo-get
VERSION=$(cargo get workspace.package.version)
TAG=${{ steps.release_info.outputs.tag_name }}
if [[ "v$VERSION" != "$TAG" ]]; then
echo "Version in Cargo.toml ($VERSION) does not match release tag ($TAG)"
exit 1
fi
fi
# Creates a `nightly-SHA` tag for this specific nightly
# This tag is used for this specific nightly version's release
# which allows users to roll back. It is also used to build
# the changelog.
- name: Create build-specific nightly tag
if: ${{ env.IS_NIGHTLY == 'true' }}
uses: actions/github-script@v5
env:
TAG_NAME: ${{ steps.release_info.outputs.tag_name }}
with:
script: |
const createTag = require('./.github/scripts/create-tag.js')
await createTag({ github, context }, process.env.TAG_NAME)
- name: Build changelog
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v2
with:
configuration: "./.github/changelog.json"
fromTag: ${{ env.IS_NIGHTLY == 'true' && 'nightly' || '' }}
toTag: ${{ steps.release_info.outputs.tag_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
cargo install cargo-get
echo "tag_name=$(cargo get workspace.package.version)" >> $GITHUB_OUTPUT
release:
name: ${{ matrix.job.target }} (${{ matrix.job.os }})
Expand Down Expand Up @@ -152,7 +100,7 @@ jobs:
- name: Archive binaries
id: artifacts
env:
VERSION_NAME: ${{ (env.IS_NIGHTLY == 'true' && 'nightly') || needs.prepare.outputs.tag_name }}
VERSION_NAME: ${{ needs.prepare.outputs.tag_name }}
run: |
if [ "$PLATFORM_NAME" == "linux" ]; then
tar -czvf "dojo_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C ./target/${TARGET}/release katana sozo torii dojo-language-server
Expand All @@ -174,23 +122,9 @@ jobs:
- name: Create release
uses: softprops/action-gh-release@v1
with:
name: ${{ needs.prepare.outputs.release_name }}
name: ${{ github.event.pull_request.title }}
tag_name: ${{ needs.prepare.outputs.tag_name }}
prerelease: ${{ env.IS_NIGHTLY == 'true' }}
body: ${{ needs.prepare.outputs.changelog }}
files: |
${{ steps.artifacts.outputs.file_name }}
# If this is a nightly release, it also updates the release
# tagged `nightly` for compatibility with `dojoup`
- name: Update nightly release
if: ${{ env.IS_NIGHTLY == 'true' }}
uses: softprops/action-gh-release@v1
with:
name: "Nightly"
tag_name: "nightly"
prerelease: true
body: ${{ needs.prepare.outputs.changelog }}
body: ${{ github.event.pull_request.body }}
files: |
${{ steps.artifacts.outputs.file_name }}
Expand All @@ -212,31 +146,6 @@ jobs:
path: ${{ env.PLATFORM_NAME }}
retention-days: 1

cleanup:
name: Release cleanup
runs-on: ubuntu-latest
needs: release

steps:
- name: Checkout sources
uses: actions/checkout@v2

# Moves the `nightly` tag to `HEAD`
- name: Move nightly tag
if: ${{ env.IS_NIGHTLY == 'true' }}
uses: actions/github-script@v5
with:
script: |
const moveTag = require('./.github/scripts/move-tag.js')
await moveTag({ github, context }, 'nightly')
- name: Delete old nightlies
uses: actions/github-script@v5
with:
script: |
const prunePrereleases = require('./.github/scripts/prune-prereleases.js')
await prunePrereleases({github, context})
docker-build-and-push:
name: Build and push docker image
runs-on: ubuntu-latest-4-cores
Expand Down
7 changes: 3 additions & 4 deletions dojoup/dojoup
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ main() {
| tr -d '"' \
| head -n 1)
DOJOUP_VERSION=$DOJOUP_TAG
elif [[ "$DOJOUP_VERSION" == nightly* ]]; then
DOJOUP_VERSION="nightly"
elif [[ "$DOJOUP_VERSION" == [[:digit:]]* ]]; then
# Add v prefix
DOJOUP_VERSION="v${DOJOUP_VERSION}"
Expand Down Expand Up @@ -288,8 +286,9 @@ banner() {
Repo : https://github.com/dojoengine/dojo
Book : https://book.dojoengine.org/
Chat : https://t.me/+DJxNYR3rsfJmZTg1
Book : https://book.dojoengine.org/
Chat : https://discord.gg/dojoengine
https://t.me/dojoengine
═════════════════════════════════════════════════════════════════════════
Expand Down

0 comments on commit 90fa4f3

Please sign in to comment.