-
Notifications
You must be signed in to change notification settings - Fork 30
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
Move to a weekly release scheme #538
Merged
Merged
Changes from 20 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
355bd1d
Move to a weekly release scheme
jiribenes 5b34373
Split CI into two parts: tagging automatically & releasing; add NPM
jiribenes 1c9f9f0
Remove one of the NPM packages
jiribenes d81fd0a
Backport: bump action versions
jiribenes fb812ba
Backport: update MVN & NPM versions via sbt
jiribenes 658f205
Backport: determine deploy version correctly
jiribenes 0219254
Backport: generate pretty release notes
jiribenes fd37230
Modify NPM command: add provenance, remove scope
jiribenes 30e1961
Fix manual push
jiribenes 9c5df5e
Backport: bump minor version every time
jiribenes d34effc
Backport: correct version resolution
jiribenes 57a8332
Minimise diff, backport action version bumps
jiribenes 4d37de7
Backport: bump setup-java version to v4
jiribenes dc7f94d
Update package.json
jiribenes 73c577e
Fix 'sbt install' since npm package has a different name
jiribenes d510c25
Try fixing the path to the Effekt binary
jiribenes d33ce97
Backport: separate version file
jiribenes 6a08574
Backport: fixes regarding separate version file
jiribenes 93e124c
Backport: Move tests to autorelease.yml
jiribenes d28fc48
Backport: run tests with retry in autorelease
jiribenes 23884ac
Backport: proper retry command, rerun only failed tests
jiribenes e8b2d83
Backport: nicer text description of tasks & DRY
jiribenes 27e66d6
Backport: Use env for a correct NodeJS/Java version
jiribenes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
name: Create Version and Tag | ||
# If you change this name, don't forget to change the name in 'deploy.yml'! | ||
|
||
on: | ||
schedule: | ||
- cron: '0 3 * * 1' # Every Monday at 3am UTC | ||
workflow_dispatch: # For manual triggering | ||
|
||
jobs: | ||
run-tests: # redux of usual CI defined in `ci.yml` | ||
name: Run tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: 'true' | ||
|
||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '11' | ||
distribution: 'zulu' | ||
cache: 'sbt' | ||
|
||
- name: Set up NodeJS | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '12.x' | ||
|
||
- name: Install MLton | ||
run: | | ||
curl -L https://github.com/MLton/mlton/releases/download/on-20210117-release/mlton-20210117-1.amd64-linux-glibc2.31.tgz --output mlton.tgz | ||
tar -xzf mlton.tgz | ||
mv mlton-20210117-1.amd64-linux-glibc2.31 $GITHUB_WORKSPACE/mlton | ||
chmod +x $GITHUB_WORKSPACE/mlton/bin/mlton | ||
echo "Trying to call directly" | ||
$GITHUB_WORKSPACE/mlton/bin/mlton | ||
echo "Adding mlton to path" | ||
echo "$GITHUB_WORKSPACE/mlton/bin" >> $GITHUB_PATH | ||
|
||
- name: Install Chez Scheme, LLVM & libuv | ||
run: sudo apt-get install -y chezscheme llvm-15 libuv1-dev | ||
|
||
- name: Run tests with retry | ||
uses: nick-fields/retry@v3 | ||
with: | ||
timeout_minutes: 120 # NOTE: This needs _some_ value. As of writing this, 2 hours should be future-proof. :) | ||
max_attempts: 3 | ||
retry_on: error | ||
run: sbt clean test | ||
|
||
calculate-version-and-tag: | ||
name: Calculate Version and Create Tag | ||
runs-on: ubuntu-latest | ||
needs: [run-tests] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '11' | ||
distribution: 'zulu' | ||
cache: 'sbt' | ||
|
||
- name: Set up NodeJS | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '12.x' | ||
|
||
- name: Bump version using sbt | ||
id: set-version | ||
run: | | ||
# Capture the output of 'sbt bumpMinorVersion' | ||
full_output=$(sbt 'bumpMinorVersion' -error) | ||
|
||
# Extract the actual version number using grep | ||
new_version=$(echo "$full_output" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | tail -n 1) | ||
|
||
# Trim any potential whitespace | ||
new_version=$(echo "$new_version" | xargs) | ||
|
||
# Check that the new_version is actually non-empty and looks like a version number | ||
if [[ ! $new_version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||
echo "Error: Version bump failed. Invalid version number: '${new_version}'" | ||
echo "Full output was:" | ||
echo "$full_output" | ||
exit 1 | ||
fi | ||
|
||
echo "VERSION=${new_version}" >> $GITHUB_OUTPUT | ||
echo "Successfully set new version: ${new_version}" | ||
|
||
- name: Update NPM and MVN versions via sbt | ||
run: sbt updateVersions | ||
|
||
- name: Commit and push changes | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "github-actions[bot]" | ||
git add project/EffektVersion.scala | ||
git add package.json | ||
git add pom.xml | ||
git commit -m "Bump version to ${{ steps.set-version.outputs.VERSION }}" | ||
git push | ||
|
||
- name: Create and push tag | ||
run: | | ||
git tag v${{ steps.set-version.outputs.VERSION }} | ||
git push origin v${{ steps.set-version.outputs.VERSION }} |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#!/bin/bash | ||
java -jar "$(npm root -g)/effekt/bin/effekt" $@ | ||
java -jar "$(npm root -g)/@effekt-lang/effekt/bin/effekt" $@ | ||
jiribenes marked this conversation as resolved.
Show resolved
Hide resolved
|
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// Don't change this file without changing the CI too! | ||
import sbt.* | ||
import sbt.Keys.* | ||
object EffektVersion { lazy val effektVersion = "0.2.2" } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we don't want to depend on an external action, we could also add something like the following: