Skip to content

Commit

Permalink
Update build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mmnga authored Sep 2, 2023
1 parent 2068725 commit a664590
Showing 1 changed file with 64 additions and 64 deletions.
128 changes: 64 additions & 64 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -414,70 +414,70 @@ jobs:
path: |
cudart-llama-bin-win-cu${{ matrix.cuda }}-x64.zip
release:
if: github.repository_owner == 'ggerganov' && ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}

runs-on: ubuntu-latest

needs:
- ubuntu-focal-make
- ubuntu-latest-cmake
- macOS-latest-make
- macOS-latest-cmake
- windows-latest-cmake
- windows-latest-cmake-cublas

steps:
- name: Clone
id: checkout
uses: actions/checkout@v1

- name: Determine tag name
id: tag
shell: bash
run: |
BUILD_NUMBER="$(git rev-list --count HEAD)"
SHORT_HASH="$(git rev-parse --short=7 HEAD)"
if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
else
SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
fi
- name: Download artifacts
id: download-artifact
uses: actions/download-artifact@v3

- name: Create release
id: create_release
uses: anzz1/action-create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag.outputs.name }}

- name: Upload release
id: upload_release
uses: actions/github-script@v3
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const path = require('path');
const fs = require('fs');
const release_id = '${{ steps.create_release.outputs.id }}';
for (let file of await fs.readdirSync('./artifact')) {
if (path.extname(file) === '.zip') {
console.log('uploadReleaseAsset', file);
await github.repos.uploadReleaseAsset({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: release_id,
name: file,
data: await fs.readFileSync(`./artifact/${file}`)
});
}
}
# release:
# if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}

# runs-on: ubuntu-latest

# needs:
# - ubuntu-focal-make
# - ubuntu-latest-cmake
# - macOS-latest-make
# - macOS-latest-cmake
# - windows-latest-cmake
# - windows-latest-cmake-cublas

# steps:
# - name: Clone
# id: checkout
# uses: actions/checkout@v1

# - name: Determine tag name
# id: tag
# shell: bash
# run: |
# BUILD_NUMBER="$(git rev-list --count HEAD)"
# SHORT_HASH="$(git rev-parse --short=7 HEAD)"
# if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
# echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
# else
# SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
# echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
# fi

# - name: Download artifacts
# id: download-artifact
# uses: actions/download-artifact@v3

# - name: Create release
# id: create_release
# uses: anzz1/action-create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ steps.tag.outputs.name }}

# - name: Upload release
# id: upload_release
# uses: actions/github-script@v3
# with:
# github-token: ${{secrets.GITHUB_TOKEN}}
# script: |
# const path = require('path');
# const fs = require('fs');
# const release_id = '${{ steps.create_release.outputs.id }}';
# for (let file of await fs.readdirSync('./artifact')) {
# if (path.extname(file) === '.zip') {
# console.log('uploadReleaseAsset', file);
# await github.repos.uploadReleaseAsset({
# owner: context.repo.owner,
# repo: context.repo.repo,
# release_id: release_id,
# name: file,
# data: await fs.readFileSync(`./artifact/${file}`)
# });
# }
# }

# ubuntu-latest-gcc:
# runs-on: ubuntu-latest
Expand Down

0 comments on commit a664590

Please sign in to comment.