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

[release] 0.0.3-test #12

Open
wants to merge 26 commits into
base: unstable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
8f0a84f
Add missing argument to release-publish.sh
shonfeder Jan 19, 2021
c038e44
Update CHANGES.md and bump version in same commit
shonfeder Jan 21, 2021
77af75b
Add flag to prevent posting release notes in PR
shonfeder Jan 21, 2021
13fbcbe
Add flag to disable building in release-publish.sh
shonfeder Jan 21, 2021
789c64a
Reformat invocation of hub command
shonfeder Jan 21, 2021
6d0afbd
Use the apalche-bot token preparing the release
shonfeder Jan 21, 2021
9c9a9ea
Use CI variable to determine CI behavior
shonfeder Jan 21, 2021
704036a
Upload release artifacts in release-prepare workflow
shonfeder Jan 21, 2021
5dc52f5
Fix release jar variable
shonfeder Jan 21, 2021
1f656e7
Fix VERSION var in version-bump.sh
shonfeder Jan 21, 2021
d962655
Add release workflow
shonfeder Jan 21, 2021
dc2bcb4
Remove unneeded CI flags
shonfeder Jan 21, 2021
98b6d35
Drafting release workflow
shonfeder Jan 21, 2021
af3cc31
More drafting
shonfeder Jan 21, 2021
53edce1
Tweaky tweak
shonfeder Jan 21, 2021
2e8a34e
Fix branch of PR
shonfeder Jan 21, 2021
e6c8218
Fix fetch depth
shonfeder Jan 21, 2021
883c6ba
Trigger actual release process
shonfeder Jan 21, 2021
1f5cebc
Remove old upload step
shonfeder Jan 21, 2021
7294d9c
Add missing closed type for PR trigger
shonfeder Jan 21, 2021
b1fee19
Fix RELEASE_JAR var
shonfeder Jan 21, 2021
8a27d61
[release] 0.0.2-test
Jan 21, 2021
bd27278
Bump version to 0.0.3-test-SNAPSHOT
Jan 21, 2021
616ab36
Merge pull request #11 from shonfeder/release/0.0.2-test
shonfeder Jan 21, 2021
be9d394
[release] 0.0.3-test
Jan 25, 2021
eaeda9d
Bump version to 0.0.4-test-SNAPSHOT
Jan 25, 2021
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
9 changes: 5 additions & 4 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Prepare Release
name: prepare-release

on:
workflow_dispatch:
Expand All @@ -18,7 +18,7 @@ jobs:
prepare-release:
env:
RELEASE_VERSION: ${{ github.event.inputs.release_version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.APALACHE_BOT_TOKEN }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -29,6 +29,7 @@ jobs:
run: |
git config --global user.name "$GITHUB_ACTOR"
git config --global user.email "github@actions.ci"
- name: Prepare Release
- name: Prepare release
run: |
./script/release-prepare.sh
# FIXME
POST_BODY=false ./script/release-prepare.sh
19 changes: 14 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
name: release

on:
push:
branches: unstable
# This file only changes when we've prepared a new release
paths: ./RELEASE-NOTES.md
pull_request:
branches: [unstable]
types: [closed]

jobs:
cut-release:
# Trigger only on merge of [release] pull request
if: startsWith(github.event.pull_request.title, '[release]') && github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# See https://github.com/actions/checkout/issues/124#issuecomment-606277160
ref: ${{ github.event.pull_request.head.ref }}
# We only need the two commits of the release prep branch
fetch-depth: 2
- uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Cut Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HEAD_REF: ${{ github.head_ref }}
run: |
git config --global user.name "$GITHUB_ACTOR"
git config --global user.email "github@actions.ci"
cit checkout HEAD~1
git checkout HEAD~1
./script/release-publish.sh
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
This file is generated. Do not write release notes here.
Notes for unreleased changes go in ./UNRELEASED.md -->

## 0.0.3-test


## 0.0.2-test


## 0.8.1

### Bug fixes
Expand Down
4 changes: 2 additions & 2 deletions mod-distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
<parent>
<groupId>at.forsyte.apalache</groupId>
<artifactId>apalache</artifactId>
<version>0.8.2-SNAPSHOT</version>
<version>0.0.4-test-SNAPSHOT</version>
</parent>

<artifactId>apalache-pkg</artifactId>
<version>0.8.2-SNAPSHOT</version>
<version>0.0.4-test-SNAPSHOT</version>
<packaging>pom</packaging>

<name>apalache-pkg</name>
Expand Down
4 changes: 2 additions & 2 deletions mod-infra/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<parent>
<groupId>at.forsyte.apalache</groupId>
<artifactId>apalache</artifactId>
<version>0.8.2-SNAPSHOT</version>
<version>0.0.4-test-SNAPSHOT</version>
</parent>

<artifactId>infra</artifactId>
<version>0.8.2-SNAPSHOT</version>
<version>0.0.4-test-SNAPSHOT</version>
<packaging>jar</packaging>

<name>infra</name>
Expand Down
4 changes: 2 additions & 2 deletions mod-tool/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
<parent>
<groupId>at.forsyte.apalache</groupId>
<artifactId>apalache</artifactId>
<version>0.8.2-SNAPSHOT</version>
<version>0.0.4-test-SNAPSHOT</version>
</parent>

<!--
All command line tooling and option parsing goes here... and nothing else!
-->
<artifactId>tool</artifactId>
<version>0.8.2-SNAPSHOT</version>
<version>0.0.4-test-SNAPSHOT</version>
<packaging>jar</packaging>

<name>tool</name>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>at.forsyte.apalache</groupId>
<artifactId>apalache</artifactId>
<packaging>pom</packaging>
<version>0.8.2-SNAPSHOT</version>
<version>0.0.4-test-SNAPSHOT</version>

<name>APALACHE project</name>
<url>https://github.com/informalsystems/apalache</url>
Expand Down
21 changes: 20 additions & 1 deletion script/release-prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@ set -o xtrace

# Perpare a release on the current branch

# Set to false to prevent posting release notes in pull request
POST_BODY=${POST_BODY:-'true'}

# The directory of this file
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
# shellcheck source=./shared.sh
. "$DIR"/shared.sh

cd "$PROJ_ROOT"

# make sure that we do not release uncommited files
if ! (git diff --exit-code && git diff --cached --exit-code) >/dev/null
then
Expand All @@ -19,6 +24,7 @@ fi

RELEASE_VERSION=${RELEASE_VERSION:-''}

# Set the new version in the source code
if [ -n "$RELEASE_VERSION" ]
then
# Explicitly set the release version
Expand All @@ -29,7 +35,10 @@ else
RELEASE_VERSION=$("$DIR"/get-version.sh)
fi

# Prepare the release on a new branch
git checkout -b "release/${RELEASE_VERSION}"

# Generatre the release notes
RELEASE_VERSION=$RELEASE_VERSION "$DIR"/release-notes.sh

# Make the release commit
Expand All @@ -38,11 +47,21 @@ git add --update
git add "$RELEASE_NOTES"
git commit -m "$commit_msg"

if [[ "$POST_BODY" == true ]]
then
body=$(cat "$RELEASE_NOTES")
else
body=''
fi

body=$(cat "$RELEASE_NOTES")

# Bump the version
"$DIR"/version-bump.sh

# Open a pull request for the release
# See https://hub.github.com/hub-pull-request.1.html
hub pull-request --push --message="$commit_msg" --message="$body" --base="unstable"
hub pull-request \
--push \
--message="$commit_msg" --message="$body" \
--base="unstable"
24 changes: 13 additions & 11 deletions script/release-publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
# shellcheck source=./shared.sh
. "$DIR"/shared.sh

VERSION=$("$DIR"/get-version.sh)
msg=$(git show -s --format=%s HEAD)

# make sure that we do not release uncommited files
if ! (git diff --exit-code && git diff --cached --exit-code) >/dev/null
then
echo "error: Git directory is not clean. Remove changes to tracked files."
exit 3
fi

VERSION=$("$DIR"/get-version.sh)
msg=$(git show -s --format=%s HEAD)

if [[ "$msg" != "[release] ${VERSION}" ]]
then
echo "error: HEAD commit must be a [release] commit"
Expand All @@ -39,28 +39,30 @@ cd "$PROJ_ROOT"
make clean
make apalache

release="mod-distribution/target/apalache-pkg-${VERSION}-full.jar"
# Location of the jar that get's published in releases
RELEASE_JAR="${PROJ_ROOT}/mod-distribution/target/apalache-pkg-${VERSION}-full.jar"

# Confirm the jar was produced
if [ ! -f "$release" ]; then
echo "error: release file not found: $release"
if [ ! -f "$RELEASE_JAR" ]; then
echo "error: release file not found: $RELEASE_JAR"
exit 6
fi

# Package the artifacts
TAG_NAME="v${VERSION}"

# Package the artifacts
ZIPF="target/apalache-${TAG_NAME}.zip"
TGZF="target/apalache-${TAG_NAME}.tgz"
zip -r "$ZIPF" bin/apalache-mc "$release"
tar zpcf "$TGZF" bin/apalache-mc "$release"
zip -r "$ZIPF" bin/apalache-mc "$RELEASE_JAR"
tar zpcf "$TGZF" bin/apalache-mc "$RELEASE_JAR"

# Tag the commit and push the tag
git tag -a $TAG_NAME -m "$msg"
git tag -a "$TAG_NAME" -m "$msg"
git push --tags

# Publish the release
body=$(cat "$RELEASE_NOTES")
hub release create \
--attach="$ZIPF" --attach="$TGZF" \
--message="$TAG_NAME" --message="$body"
--message="$TAG_NAME" --message="$body" \
"$TAG_NAME"
8 changes: 4 additions & 4 deletions script/shared.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ exports () {
local DIR
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

export PROJ_ROOT=$DIR"/.."
export UNRELEASED=$PROJ_ROOT"/UNRELEASED.md"
export CHANGES=$PROJ_ROOT"/CHANGES.md"
export RELEASE_NOTES=$PROJ_ROOT"/RELEASE-NOTES.md"
export PROJ_ROOT="${DIR}/.."
export UNRELEASED="${PROJ_ROOT}/UNRELEASED.md"
export CHANGES="${PROJ_ROOT}/CHANGES.md"
export RELEASE_NOTES="${PROJ_ROOT}/RELEASE-NOTES.md"
}
exports
16 changes: 13 additions & 3 deletions script/version-bump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,23 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
# shellcheck source=./shared.sh
. "$DIR"/shared.sh

cd "$PROJ_ROOT"

VERSION=$("$DIR"/get-version.sh)
"$DIR"/update-changes.sh
git add --update
git commit -m "Update changelog for version ${VERSION}"

msg=$(git show -s --format=%s HEAD)
if [[ "$msg" != "[release] ${VERSION}" ]]
then
echo "error: HEAD commit must be a [release] commit"
echo "found: ${msg}"
exit 4
fi

# Bump version to next SNAPSHOT
mvn --batch-mode release:update-versions -DautoVersionSubmodules=true

"$DIR"/update-changes.sh

DEV_VERSION=$("$DIR"/get-version.sh)
git add --update
git commit -m "Bump version to ${DEV_VERSION}"
4 changes: 2 additions & 2 deletions tla-assignments/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<parent>
<groupId>at.forsyte.apalache</groupId>
<artifactId>apalache</artifactId>
<version>0.8.2-SNAPSHOT</version>
<version>0.0.4-test-SNAPSHOT</version>
</parent>

<artifactId>tla-assignments</artifactId>
<version>0.8.2-SNAPSHOT</version>
<version>0.0.4-test-SNAPSHOT</version>
<packaging>jar</packaging>

<name>tla-assignments</name>
Expand Down
4 changes: 2 additions & 2 deletions tla-bmcmt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<parent>
<groupId>at.forsyte.apalache</groupId>
<artifactId>apalache</artifactId>
<version>0.8.2-SNAPSHOT</version>
<version>0.0.4-test-SNAPSHOT</version>
</parent>

<artifactId>tla-bmcmt</artifactId>
<version>0.8.2-SNAPSHOT</version>
<version>0.0.4-test-SNAPSHOT</version>
<packaging>jar</packaging>

<name>tla-bmcmt</name>
Expand Down
4 changes: 2 additions & 2 deletions tla-import/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<parent>
<groupId>at.forsyte.apalache</groupId>
<artifactId>apalache</artifactId>
<version>0.8.2-SNAPSHOT</version>
<version>0.0.4-test-SNAPSHOT</version>
</parent>

<artifactId>tla-import</artifactId>
<version>0.8.2-SNAPSHOT</version>
<version>0.0.4-test-SNAPSHOT</version>
<packaging>jar</packaging>

<name>tla-import</name>
Expand Down
4 changes: 2 additions & 2 deletions tla-pp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<parent>
<groupId>at.forsyte.apalache</groupId>
<artifactId>apalache</artifactId>
<version>0.8.2-SNAPSHOT</version>
<version>0.0.4-test-SNAPSHOT</version>
</parent>

<artifactId>tla-pp</artifactId>
<version>0.8.2-SNAPSHOT</version>
<version>0.0.4-test-SNAPSHOT</version>
<packaging>jar</packaging>

<name>tla-pp</name>
Expand Down
4 changes: 2 additions & 2 deletions tla-types/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<parent>
<groupId>at.forsyte.apalache</groupId>
<artifactId>apalache</artifactId>
<version>0.8.2-SNAPSHOT</version>
<version>0.0.4-test-SNAPSHOT</version>
</parent>

<artifactId>tla-types</artifactId>
<version>0.8.2-SNAPSHOT</version>
<version>0.0.4-test-SNAPSHOT</version>
<packaging>jar</packaging>

<name>tla-types</name>
Expand Down
4 changes: 2 additions & 2 deletions tlair/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<parent>
<groupId>at.forsyte.apalache</groupId>
<artifactId>apalache</artifactId>
<version>0.8.2-SNAPSHOT</version>
<version>0.0.4-test-SNAPSHOT</version>
</parent>

<artifactId>tlair</artifactId>
<version>0.8.2-SNAPSHOT</version>
<version>0.0.4-test-SNAPSHOT</version>
<packaging>jar</packaging>

<name>tlair</name>
Expand Down