mirror of
https://github.com/GaloisInc/cryptol.git
synced 2024-08-16 17:30:27 +03:00
Add release versioning for cryptol
This commit is contained in:
parent
4c9ee03b59
commit
4832160fd9
2
.github/ci.sh
vendored
2
.github/ci.sh
vendored
@ -90,7 +90,7 @@ build() {
|
||||
if [[ "$ghc_ver" =~ 8.8.3|8.10.1 && $IS_WIN ]]; then JOBS=1; else JOBS=2; fi
|
||||
cabal v2-configure -j$JOBS --minimize-conflict-set
|
||||
for _ in {1..3}; do # retry due to flakiness with windows builds
|
||||
cabal v2-build "$@" cryptol:exe:cryptol cryptol:exe:cryptol-html && break
|
||||
./cry build "$@" && break
|
||||
done
|
||||
}
|
||||
|
||||
|
15
.github/workflows/build.yml
vendored
15
.github/workflows/build.yml
vendored
@ -11,10 +11,16 @@ jobs:
|
||||
changed: ${{ steps.outputs.outputs.changed-files }}
|
||||
cryptol-version: ${{ steps.outputs.outputs.cryptol-version }}
|
||||
name: ${{ steps.outputs.outputs.name }}
|
||||
release: ${{ steps.env.outputs.release }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- id: env
|
||||
if: |
|
||||
(startsWith(github.head_ref, 'release-')
|
||||
|| (github.event_name == 'pull_request' && startsWith(github.head_ref, 'actions/')))
|
||||
run: .github/ci.sh output release 1
|
||||
- id: outputs
|
||||
run: |
|
||||
.github/ci.sh set_files ${{ github.sha }}
|
||||
@ -40,6 +46,8 @@ jobs:
|
||||
- os: windows-latest
|
||||
ghc: 8.8.3
|
||||
name: Cryptol - GHC v${{ matrix.ghc }} - ${{ matrix.os }}
|
||||
env:
|
||||
RELEASE: ${{ needs.outputs.outputs.release }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
@ -88,9 +96,7 @@ jobs:
|
||||
run: .github/ci.sh test_dist
|
||||
|
||||
- if: >-
|
||||
(startsWith(github.head_ref, 'release-')
|
||||
|| (github.event_name == 'pull_request' && startsWith(github.head_ref, 'actions/')))
|
||||
&& matrix.ghc == '8.10.1'
|
||||
env.RELEASE && matrix.ghc == '8.10.1'
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
path: dist/bin
|
||||
@ -101,8 +107,7 @@ jobs:
|
||||
needs: [outputs]
|
||||
if: >-
|
||||
(startsWith(github.head_ref, 'release-')
|
||||
|| (github.event_name == 'pull_request'
|
||||
&& startsWith(github.head_ref, 'actions/')))
|
||||
|| (github.event_name == 'pull_request' && startsWith(github.head_ref, 'actions/')))
|
||||
|| contains(needs.outputs.outputs.changed, 'docs/')
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
14
cry
14
cry
@ -41,9 +41,19 @@ case $COMMAND in
|
||||
dirty_string="-- Last build $(date)"
|
||||
echo "$dirty_string" >> src/GitRev.hs
|
||||
|
||||
cabal v2-build exe:cryptol
|
||||
if [[ -n "$RELEASE" ]]; then
|
||||
sed -i.bak -e 's/^commitShortHash = .*$/commitShortHash = "UNKNOWN"/' \
|
||||
-e 's/^commitHash = .*$/commitHash = "UNKNOWN"/' \
|
||||
-e 's/^commitBranch = .*$/commitBranch = "UNKNOWN"/' \
|
||||
-e 's/^commitDirty = .*$/commitDirty = False/' \
|
||||
-e '/import qualified GitRev/d' \
|
||||
src/Cryptol/Version.hs
|
||||
rm -f src/Cryptol/Version.hs.bak
|
||||
fi
|
||||
|
||||
sed -i.bak "/^$dirty_string/d" src/GitRev.hs
|
||||
cabal v2-build "$@" exe:cryptol
|
||||
|
||||
sed -i.bak "/^-- Last build/d" src/GitRev.hs
|
||||
rm -f src/GitRev.hs.bak
|
||||
;;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user