Skip to content

Commit

Permalink
Fix release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
joaomhmpereira committed Aug 15, 2024
1 parent c191f9f commit ca5af33
Showing 1 changed file with 25 additions and 12 deletions.
37 changes: 25 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,50 @@
name: Release
name: Create Release

on:
push:
tags:
- 'v*'

jobs:
build:
release:
name: Create Release
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: actions/checkout@v2
with:
submodules: true
submodules: 'recursive'

- name: Create tarball
- name: Set filenames
run: |
echo "GITHUB_REF=$GITHUB_REF" >> "$GITHUB_ENV"
tag_or_branch="${GITHUB_REF#refs/tags/}"
tag_or_branch="${tag_or_branch#refs/heads/}"
echo "RELEASE_NAME=ocaml-cvc5-$tag_or_branch" >> "$GITHUB_ENV"
echo "RELEASE_FILE=ocaml-cvc5-$tag_or_branch.tar.gz" >> "$GITHUB_ENV"
- name: Create source distribution
run: |
tar -czvf release.tar.gz .
rm -rf "/tmp/$RELEASE_NAME"
cp -r "$PWD" "/tmp/$RELEASE_NAME"
mv "/tmp/$RELEASE_NAME" .
tar -czvf "$RELEASE_FILE" "$RELEASE_NAME"
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./release.tar.gz
asset_name: release.tar.gz
asset_path: ${{ env.RELEASE_FILE }}
asset_name: ${{ env.RELEASE_FILE }}
asset_content_type: application/gzip

0 comments on commit ca5af33

Please sign in to comment.