Skip to content

Commit

Permalink
ci: extend release workflow; automate assets uploads on tag creation (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm authored Mar 21, 2024
1 parent 0215931 commit 93f97df
Showing 1 changed file with 22 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release Development Version
name: Release

on:
workflow_dispatch:
Expand All @@ -12,7 +12,7 @@ on:
- '**/*_test.v'
- '**/*.md'
- '.github/**'
- '!**/nightly_release.yml'
- '!**/release.yml'

permissions:
contents: write
Expand Down Expand Up @@ -51,7 +51,10 @@ jobs:
submodules: true

- name: Compile
run: v run build.vsh debug
shell: bash
run: |
[ $GITHUB_REF_TYPE == tag ] && mode="release" || mode="debug"
v run build.vsh $mode
- name: Upload artifact
uses: actions/upload-artifact@v4
Expand All @@ -62,23 +65,36 @@ jobs:
- name: Prepare release
shell: bash
run: |
now=$(date -u +'%Y-%m-%d %H:%M:%S UTC')
echo "BODY=Generated on <samp>$now</samp> from commit ${{ github.sha }}." >> $GITHUB_ENV
7z a -tzip ${{ env.ARTIFACT }}.zip ./bin/v-analyzer${{ matrix.bin_ext }}
if [ $GITHUB_REF_TYPE != tag ]; then
now=$(date -u +'%Y-%m-%d %H:%M:%S UTC')
echo "BODY=Generated on <samp>$now</samp> from commit ${{ github.sha }}." >> $GITHUB_ENV
fi
- name: Update nightly tag
if: github.ref_type != 'tag'
uses: richardsimko/update-tag@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: nightly

- name: Release
- name: Release development version
if: github.ref_type != 'tag'
uses: ncipollo/release-action@v1
with:
artifacts: ${{ env.ARTIFACT }}.zip
tag: nightly
body: ${{ env.BODY }}
name: v-analyzer development build
allowUpdates: true
prerelease: true

- name: Release latest version
if: github.ref_type == 'tag'
uses: ncipollo/release-action@v1
with:
artifacts: ${{ env.ARTIFACT }}.zip
allowUpdates: true
omitBodyDuringUpdate: true
omitNameDuringUpdate: true

0 comments on commit 93f97df

Please sign in to comment.