Skip to content
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

automatic calendar-versioning based releases #935

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,26 @@ jobs:
run: sudo xargs apt-get install -y < .github/workflows/apt-packages.txt

- run: ci-tests/test-spike

- name: Calver Release
scottj97 marked this conversation as resolved.
Show resolved Hide resolved
uses: StephaneBour/actions-calver@master
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who is StephaneBour?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The github action file is provided by that user : https://github.com/StephaneBour/actions-calver

id: calver
with:
date_format: "%Y-%m-%d"
release: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Release
id: create_release
if: github.ref == 'refs/heads/master'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
release_branch: refs/heads/master
release_name: ${{ steps.calver.outputs.release }}
tag_name: ${{ steps.calver.outputs.release }}
draft: false
prerelease: false

3 changes: 3 additions & 0 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@
/* Default value for --with-target switch */
#undef TARGET_ARCH

/* Define git release version */
#undef VERSION
scottj97 marked this conversation as resolved.
Show resolved Hide resolved

/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
Expand Down
6 changes: 6 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -6423,6 +6423,12 @@ ac_config_files="$ac_config_files riscv-fesvr.pc"

ac_config_files="$ac_config_files riscv-disasm.pc"

VERSION=`git describe --tags $(git rev-list --tags --max-count=1)`
scottj97 marked this conversation as resolved.
Show resolved Hide resolved

cat >>confdefs.h <<_ACEOF
#define VERSION "$VERSION"
_ACEOF

cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
Expand Down
4 changes: 4 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,8 @@ AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([riscv-fesvr.pc])
AC_CONFIG_FILES([riscv-disasm.pc])
VERSION=`git describe --tags $(git rev-list --tags --max-count=1)`
AC_DEFINE_UNQUOTED([VERSION],
["$VERSION"],
[Define git release version])
AC_OUTPUT
2 changes: 1 addition & 1 deletion spike_main/spike.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

static void help(int exit_code = 1)
{
fprintf(stderr, "Spike RISC-V ISA Simulator " SPIKE_VERSION "\n\n");
fprintf(stderr, "Spike RISC-V ISA Simulator " VERSION "\n\n");
scottj97 marked this conversation as resolved.
Show resolved Hide resolved
fprintf(stderr, "usage: spike [host options] <target program> [target options]\n");
fprintf(stderr, "Host Options:\n");
fprintf(stderr, " -p<n> Simulate <n> processors [default 1]\n");
Expand Down