redgold 0.1.21

p2p database / compute engine & portfolio target models
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
name: Continuous Integration
env:
  BUILD_OUTPUT: "./target/release/redgold"
  AWS_EC2_METADATA_DISABLED: true
  S3_RELEASE_PREFIX: "s3://redgold-public/release"
  S3_EXPLORER_PREFIX: "s3://redgold-explorer"
  S3_DOCS_PREFIX: "s3://redgold-docs"
  DOCKER_USER: "redgoldio"
  TOOLCHAIN: "stable"
  DATABASE_URL: "sqlite:///home/runner/work/redgold-core/redgold-core/.rg/sqlx/data_store.sqlite"
on: push
jobs:
  test:
    if:
      ${{ !contains('
      refs/heads/predev
      refs/heads/dev
      refs/heads/staging
      refs/heads/test
      refs/heads/main
      ', github.ref) }}
    runs-on: ubuntu-latest-m
    timeout-minutes: 60
    permissions:
      contents: write
    outputs:
      version: ${{ steps.version.outputs.version }}
#    env:
#      DATABASE_URL: "sqlite:///home/runner/work/redgold-core/redgold-core/.rg/sqlx/data_store.sqlite"
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          node-version: '14'
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: ${{ env.TOOLCHAIN }}
      - uses: Swatinem/rust-cache@v1
        with:
          cache-on-failure: true
      - run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
      - run: echo "Github branch = ${{ env.BRANCH }}"
      - run: export VERSION=$(head Cargo.toml | grep 'version = ' | cut -d "=" -f 2 | tr -d ' "'); echo "VERSION=$VERSION" >> $GITHUB_ENV
      - id: version
        run: echo "version=${{env.VERSION}}" >> "$GITHUB_OUTPUT"
      - run: echo "Testing version = ${{ env.VERSION }}"
      - run: ./bin/install_build_deps.sh
      - run: cargo clean
      - run: export RUST_MIN_STACK=20485760; cargo test --lib -- --test-threads=1
      - run: ./bin/local_test.sh
  build-vue:
    runs-on: self-hosted
    if: contains('
      refs/heads/dev
      refs/heads/staging
      refs/heads/test
      refs/heads/main
      ', github.ref)
    timeout-minutes: 60
    steps:
      - uses: actions/checkout@v2

      - run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
      - run: echo "Github branch = ${{ env.BRANCH }}"

      - name: Build Explorer
        run: |
          cd vue-explorer;
          npm install
          npm run build;

      - name: Build Docs
        run: |
          cd docs;
          npm install
          npm run generate

      - name: Configure AWS Keys
        run: |
          aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS }}
          aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET }}

      - name: Upload Explorer Distribution to S3
        run: aws s3 rm --recursive ${{env.S3_EXPLORER_PREFIX}}-${{env.BRANCH}} && aws s3 cp --recursive ./vue-explorer/dist/ ${{env.S3_EXPLORER_PREFIX}}-${{env.BRANCH}}/

      - name: Upload Docs Distribution to S3
        run: aws s3 rm --recursive ${{env.S3_DOCS_PREFIX}}-${{env.BRANCH}} && aws s3 cp --recursive ./docs/dist/ ${{env.S3_DOCS_PREFIX}}-${{env.BRANCH}}/

  build-linux:
#    needs: [test]
    if:
      contains('
      refs/heads/predev
      refs/heads/dev
      refs/heads/staging
      refs/heads/test
      refs/heads/main
      ', github.ref)
    runs-on: ubuntu-latest-m
    timeout-minutes: 100
    permissions:
      contents: write
#    env:
#      DATABASE_URL: "sqlite:///home/runner/work/redgold-core/redgold-core/.rg/sqlx/data_store.sqlite"
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          node-version: '14'
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: ${{ env.TOOLCHAIN }}
      - uses: Swatinem/rust-cache@v1
        with:
          cache-on-failure: true
        # TODO: Update to use release plugin
        #      - run: cargo install cargo-release
        #      - run: cargo release # --execute --no-confirm --token ${{ secrets.GITHUB_TOKEN }}
      - run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
      - run: echo "Github branch = ${{ env.BRANCH }}"
      - run: export VERSION=$(head Cargo.toml | grep 'version = ' | cut -d "=" -f 2 | tr -d ' "'); echo "VERSION=$VERSION" >> $GITHUB_ENV
      - run: echo "Testing version = ${{ env.VERSION }}"
      - run: ./bin/install_build_deps.sh
      - run: rustup toolchain list
      - run: rustup default nightly
      - run: rustup update
      - run: rustup -V
      - run: cargo clean
      - run: export RUST_MIN_STACK=20485760; cargo test --lib -- --test-threads=1
      - run: cargo build --release
        # try CWD?
#      - run: ./bin/local_test.sh "./target/release/redgold"

      - run: cp ${{ env.BUILD_OUTPUT }} ./redgold_linux

      - uses: actions/upload-artifact@v3
        with:
          name: redgold_linux
          path: ./redgold_linux
#    needs: [test]
  build-linux-ubuntu-20:
    if:
      contains('
      refs/heads/predev
      refs/heads/dev
      refs/heads/staging
      refs/heads/test
      refs/heads/main
      ', github.ref)
    runs-on: ubuntu-20.04
    timeout-minutes: 100
    permissions:
      contents: write
    steps:
      - uses: actions/checkout@v2
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: ${{ env.TOOLCHAIN }}
      - uses: Swatinem/rust-cache@v1
        with:
          cache-on-failure: true
      - run: ./bin/install_build_deps.sh
      - run: cargo build --release
      - run: cp ${{ env.BUILD_OUTPUT }} ./redgold_linux_ubuntu20
      - uses: actions/upload-artifact@v3
        with:
          name: redgold_linux_ubuntu20
          path: ./redgold_linux_ubuntu20
  build-windows:
    #    needs: [test]
    if:
      contains('
      refs/heads/predev
      refs/heads/dev
      refs/heads/staging
      refs/heads/test
      refs/heads/main
      ', github.ref)
    runs-on: windows-latest
    timeout-minutes: 100
    permissions:
      contents: write
    env:
      DATABASE_URL: "sqlite:///Users/runner/work/redgold-core/redgold-core/.rg/sqlx/data_store.sqlite"
    outputs:
      release_match: ${{ steps.check-branch.outputs.match }}
    steps:
      - name: Checkout
        uses: actions/checkout@v1
      - name: Install latest rust toolchain
        uses: actions-rs/toolchain@v1
        with:
          toolchain: ${{ env.TOOLCHAIN }}
          target: x86_64-pc-windows-gnu
          default: true
          override: true
      - uses: msys2/setup-msys2@v2
      - run: echo "asdf" > ./redgold.exe
        # Currently broken due to external change.
#      - shell: msys2 {0}
#        name: "Msys2 cargo build with dependencies"
#        if:
#          contains('
#          refs/heads/staging
#          refs/heads/test
#          refs/heads/main
#          ', github.ref)
#        run: |
#          export PATH="$HOME/.cargo/bin:$PATH"
#          uname -a
#          ls -lA
#          pwd
#          pacman -S --noconfirm mingw-w64-x86_64-gmp
#          pacman -S --noconfirm mingw-w64-x86_64-rust
#          pacman -S --noconfirm mingw-w64-x86_64-openssl
#          pacman -S --noconfirm make
#          echo "OPENSSL_DIR=/mingw64" >> $GITHUB_ENV
#          echo "OPENSSL_STATIC=yes" >> $GITHUB_ENV
#          cargo build --release --target x86_64-pc-windows-gnu
#          ls
#          ls target/
#          ls target/x86_64-pc-windows-gnu/
#          ls target/x86_64-pc-windows-gnu/release/
#          cp target/x86_64-pc-windows-gnu/release/redgold.exe ./redgold.exe
      - uses: actions/upload-artifact@v3
        with:
          name: redgold.exe
          path: ./redgold.exe
  build-mac:
#    needs: [test]
    if:
      contains('
      refs/heads/predev
      refs/heads/dev
      refs/heads/staging
      refs/heads/test
      refs/heads/main
      ', github.ref)
    runs-on: macos-latest
    timeout-minutes: 100
    permissions:
      contents: write
    env:
      DATABASE_URL: "sqlite:///Users/runner/work/redgold-core/redgold-core/.rg/sqlx/data_store.sqlite"
    outputs:
      release_match: ${{ steps.check-branch.outputs.match }}
    steps:
      - name: Checkout
        uses: actions/checkout@v1
#      - name: Cache Rust dependencies
#        uses: actions/cache@v1.0.1
#        with:
#          path: target
#          key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }}
#          restore-keys: |
#            ${{ runner.OS }}-build-
      - name: Install latest rust toolchain
        uses: actions-rs/toolchain@v1
        with:
          toolchain: ${{ env.TOOLCHAIN }}
          target: x86_64-apple-darwin
          default: true
          override: true
      - name: Check branch
        id: check-branch
        run: ./bin/release_branches.sh
      - run: echo "release branch match output ${{ steps.check-branch.outputs.match }}"
      - run: echo steps.check-branch.outputs.match

      - run: echo "asdf" > ./redgold_mac
      - if:
          contains('
          refs/heads/staging
          refs/heads/test
          refs/heads/main
          ', github.ref)
        run: cargo clean; cargo build --release; cp ${{ env.BUILD_OUTPUT }} ./redgold_mac

      - uses: actions/upload-artifact@v3
        with:
          name: redgold_mac
          path: ./redgold_mac

  release:
    needs: [build-linux, build-mac, build-linux-ubuntu-20, build-windows, build-vue]
    if:
        contains('
          refs/heads/predev
          refs/heads/dev
          refs/heads/staging
          refs/heads/test
          refs/heads/main
          ', github.ref)
    runs-on: ubuntu-latest-m
    timeout-minutes: 100
    permissions:
      contents: write
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
      - uses: actions/download-artifact@v3
        with:
          name: redgold_linux
      - uses: actions/download-artifact@v3
        with:
          name: redgold_linux_ubuntu20
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: ${{ env.TOOLCHAIN }}
      - uses: Swatinem/rust-cache@v1
        with:
          cache-on-failure: true

      #      - uses: actions/download-artifact@v3
#        with:
#          name: redgold_mac

      - run: sleep 10

      - name: Download redgold_mac artifact
        #        if: contains('
        #          refs/heads/staging
        #          refs/heads/test
        #          refs/heads/main',
        #          github.ref)
        uses: actions/download-artifact@v3
        with:
          name: redgold_mac
      - name: Download redgold.exe windows artifact
        uses: actions/download-artifact@v3
        with:
          name: redgold.exe

      - name: Check branch
        id: check-branch
        run: ./bin/release_branches.sh
        shell: bash
      - name: Cargo Publish
        if:
          contains('
          refs/heads/staging
          ', github.ref)
        run: |
          echo "Branch is release branch, doing cargo publish"
          cargo login ${{ secrets.CARGO_TOKEN }} &&
          ./bin/install_build_deps.sh &&
          ./bin/cargo_publish.sh



      - run: ls -lA .
      - run: ls -lA ./redgold_linux

      - run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
      - run: echo "Github branch = ${{ env.BRANCH }}"
      - run: export VERSION=$(head Cargo.toml | grep 'version = ' | cut -d "=" -f 2 | tr -d ' "'); echo "VERSION=$VERSION" >> $GITHUB_ENV
      - run: echo "Testing version = ${{ env.VERSION }}"

      # Checksums
      - run: echo "BUILD_CHECKSUM=$(md5sum ./redgold_linux | cut -d ' ' -f 1 | tr -d ' ')" >> $GITHUB_ENV
      - run: echo "BUILD_CHECKSUM_SHA256=$(shasum -a 256 ./redgold_linux | cut -d ' ' -f 1 | tr -d ' ')" >> $GITHUB_ENV
      - run: echo "BUILD_SHORT_CHECKSUM=$(echo ${{env.BUILD_CHECKSUM_SHA256}} | tail -c 9)" >> $GITHUB_ENV
      - run: echo "BUILD_CHECKSUM_SHA512=$(shasum -a 512 ./redgold_linux | cut -d ' ' -f 1 | tr -d ' ')" >> $GITHUB_ENV
      - run: echo "WINDOWS_CHECKSUM=$(shasum -a 256 ./redgold.exe | cut -d ' ' -f 1 | tr -d ' ')" >> $GITHUB_ENV

      # TODO Change on branch release?
      - name: Calculate Mac SHA256 Checksum
        if:
          contains('
          refs/heads/staging
          refs/heads/test
          refs/heads/main
          ', github.ref)
        run: echo "MAC_BUILD_CHECKSUM_SHA256=$(shasum -a 256 ./redgold_mac | cut -d ' ' -f 1 | tr -d ' ')" >> $GITHUB_ENV
      - if:
          contains('
          refs/heads/predev
          refs/heads/dev
          ', github.ref)
        run: echo "MAC_BUILD_CHECKSUM_SHA256=" >> $GITHUB_ENV

      - run: chmod +x ./redgold_linux && chmod +x ./redgold_mac && chmod +X ./redgold.exe && chmod +x ./redgold_linux_ubuntu20

      # Docker Image
      # TODO: This works but need to setup self hosted registry also
      - run: rm -rf docker-build-tmp || true
      - run: mkdir docker-build-tmp
      - run: cp ./redgold_linux docker-build-tmp/redgold; chmod +x docker-build-tmp/redgold
      - run: cp release.Dockerfile docker-build-tmp/release.Dockerfile
      - run: docker rmi --force ${{ env.DOCKER_USER }}/redgold:${{env.VERSION}} || true
      - run: docker rmi --force ${{ env.DOCKER_USER }}/redgold:${{ env.BRANCH }} || true
      - run: cd docker-build-tmp; docker build -f release.Dockerfile -t ${{ env.DOCKER_USER }}/redgold:${{env.VERSION}} .; cd ..
      - run: echo ${{ secrets.DOCKER_TOKEN }} | docker login --username ${{ env.DOCKER_USER }} --password-stdin
      - run: docker tag ${{ env.DOCKER_USER }}/redgold:${{env.VERSION}} ${{ env.DOCKER_USER }}/redgold:${{ env.BRANCH }}
      - run: docker image push ${{ env.DOCKER_USER }}/redgold:${{ env.BRANCH }}

      - name: Push Docker Versioned Image
        if: steps.check-branch.outputs.match == '1'
        run: docker image push ${{ env.DOCKER_USER }}/redgold:${{env.VERSION}}

      # Todo: change to output https://docs.github.com/en/actions/using-jobs/defining-outputs-for-jobs
      - run: export DOCKER_SHA256=$(docker inspect --format='{{index .RepoDigests 0}}' ${{ env.DOCKER_USER }}/redgold:${{env.BRANCH}} | cut -d ':' -f 2 | tr -d ' '); echo "DOCKER_SHA256=$DOCKER_SHA256" >> $GITHUB_ENV

      # AWS artifacts
      - run: curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
      - run: unzip awscliv2.zip
      - run: sudo ./aws/install --update
      - run: aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS }}
      - run: aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET }}

      # AWS Docker image hash
      - run: echo ${{ env.DOCKER_SHA256 }} > docker_sha256_checksum
      - run: aws s3 cp docker_sha256_checksum ${{ env.S3_RELEASE_PREFIX }}/${{ env.BRANCH }}/docker_sha256_checksum

      - if: steps.check-branch.outputs.match == '1'
        run: aws s3 cp docker_sha256_checksum ${{ env.S3_RELEASE_PREFIX }}/v/${{env.VERSION}}/docker_sha256_checksum

      # AWS Linux artifacts
      - run: echo ${{ env.BUILD_CHECKSUM }} > md5_checksum
      - run: echo ${{ env.BUILD_CHECKSUM_SHA256 }} > sha256_checksum
      - run: echo ${{ env.BUILD_CHECKSUM_SHA512 }} > sha512_checksum

      # TODO: commit hash to file upload ${{ github.sha }}
      - run: aws s3 cp redgold_linux ${{ env.S3_RELEASE_PREFIX }}/${{ env.BRANCH }}/redgold_linux
      - run: aws s3 cp md5_checksum ${{ env.S3_RELEASE_PREFIX }}/${{ env.BRANCH }}/redgold_linux_md5_checksum
      - run: aws s3 cp sha256_checksum ${{ env.S3_RELEASE_PREFIX }}/${{ env.BRANCH }}/redgold_linux_sha256_checksum
      - run: aws s3 cp sha512_checksum ${{ env.S3_RELEASE_PREFIX }}/${{ env.BRANCH }}/redgold_linux_sha512_checksum

      # Mac
      - run: echo ${{ env.MAC_BUILD_CHECKSUM_SHA256 }} > mac_sha256_checksum
      - run: aws s3 cp mac_sha256_checksum ${{ env.S3_RELEASE_PREFIX }}/${{ env.BRANCH }}/redgold_mac_sha256_checksum
      - run: aws s3 cp redgold_mac ${{ env.S3_RELEASE_PREFIX }}/${{ env.BRANCH }}/redgold_mac
      # Windows
      - run: echo ${{ env.WINDOWS_CHECKSUM }} > windows_checksum
      - run: aws s3 cp windows_checksum ${{ env.S3_RELEASE_PREFIX }}/${{ env.BRANCH }}/redgold_windows_checksum
      - run: aws s3 cp redgold.exe ${{ env.S3_RELEASE_PREFIX }}/${{ env.BRANCH }}/redgold.exe

      # Upload versioned artifacts
      - if:
          contains('
          refs/heads/staging
          ', github.ref)
        run: |
          aws s3 cp redgold_linux ${{ env.S3_RELEASE_PREFIX }}/v/${{env.VERSION}}/redgold_linux && 
          aws s3 cp md5_checksum ${{ env.S3_RELEASE_PREFIX }}/v/${{env.VERSION}}/redgold_linux_md5_checksum &&
          aws s3 cp sha256_checksum ${{ env.S3_RELEASE_PREFIX }}/v/${{env.VERSION}}/redgold_linux_sha256_checksum &&
          aws s3 cp sha512_checksum ${{ env.S3_RELEASE_PREFIX }}/v/${{env.VERSION}}/redgold_linux_sha512_checksum &&
          aws s3 cp docker_sha256_checksum ${{ env.S3_RELEASE_PREFIX }}/v/${{env.VERSION}}/docker_sha256_checksum && 
          aws s3 cp mac_sha256_checksum ${{ env.S3_RELEASE_PREFIX }}/v/${{env.VERSION}}/redgold_mac_sha256_checksum &&
          aws s3 cp windows_checksum ${{ env.S3_RELEASE_PREFIX }}/v/${{env.VERSION}}/windows_checksum &&
          aws s3 cp redgold_mac ${{ env.S3_RELEASE_PREFIX }}/v/${{env.VERSION}}/redgold_mac
          aws s3 cp redgold.exe ${{ env.S3_RELEASE_PREFIX }}/v/${{env.VERSION}}/redgold.exe
#      - run: cd .; echo 'Intended upload path: s3://${{env.S3_EXPLORER_PREFIX}}-${{env.BRANCH}}'


# TODO: Need tags associated with staging versions for changelog.
#      - name: "Build Changelog"
#        id: build_changelog
#        uses: mikepenz/release-changelog-builder-action@v4.0.0-rc04

      - uses: dev-drprasad/delete-tag-and-release@v0.2.1
        with:
          delete_release: true # default: false
          tag_name: release/${{ env.BRANCH }} # tag name to delete
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      - name: Sleep for 5 seconds
        run: sleep 5
      # https://github.com/marketplace/actions/rust-release-binary these steps came from below
      # TODO: Duplicate this release step with 'version' tagged releases
      - name: Release Env
        uses: softprops/action-gh-release@v1
        with:
          files: |
            redgold_linux
            redgold_mac
            redgold.exe
            redgold_linux_ubuntu20
          tag_name: "release/${{ env.BRANCH }}"
          name: ${{ env.BRANCH }}
          #           ${{steps.build_changelog.outputs.changelog}}
          # TODO: Make this body a step output
          body: "
          Redgold Release
          
          env=${{ env.BRANCH }}
          
          version=${{ env.VERSION }}
                    
          commit=${{ github.sha }}
          
          docker=${{ env.DOCKER_SHA256 }}

          linux_sha256=${{ env.BUILD_CHECKSUM_SHA256 }}
          
          linux_sha256_end=${{ env.BUILD_SHORT_CHECKSUM }}
                     
          mac_sha256=${{ env.MAC_BUILD_CHECKSUM_SHA256 }}
          
          windows_sha256=${{ env.WINDOWS_CHECKSUM }}  
          
          build_number=${{ github.run_number }}
          
          "
          token: ${{ secrets.GITHUB_TOKEN }}

      - if:
          contains('
          refs/heads/staging
          ', github.ref)
        uses: dev-drprasad/delete-tag-and-release@v0.2.1
        with:
          delete_release: true # default: false
          tag_name: release/${{ env.VERSION }} # tag name to delete
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      - name: Sleep for 5 seconds
        run: sleep 5
      # https://github.com/marketplace/actions/rust-release-binary these steps came from below
      # TODO: Duplicate this release step with 'version' tagged releases
      - if:
          contains('
          refs/heads/staging
          ', github.ref)
        name: Release Versioned
        uses: softprops/action-gh-release@v1
        with:
          files: |
            redgold_linux
            redgold_mac
            redgold.exe
          tag_name: "release/${{ env.VERSION }}"
          name: ${{ env.VERSION }}
          #           ${{steps.build_changelog.outputs.changelog}}
          body: "
          Redgold Release
                    
          version=${{ env.VERSION }}
                    
          commit=${{ github.sha }}
          
          docker=${{ env.DOCKER_SHA256 }}

          linux_sha256=${{ env.BUILD_CHECKSUM_SHA256 }}
          
          linux_sha256_end=${{ env.BUILD_SHORT_CHECKSUM }}
                     
          mac_sha256=${{ env.MAC_BUILD_CHECKSUM_SHA256 }}  
          
          windows_sha256=${{ env.WINDOWS_CHECKSUM }}  
          
          build_number=${{ github.run_number }}
          
          "
          token: ${{ secrets.GITHUB_TOKEN }}