Skip to content

Update package.json. #23

Update package.json.

Update package.json. #23

Workflow file for this run

name: Release

Check failure on line 1 in .github/workflows/release.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/release.yaml

Invalid workflow file

Cannot define both `uses` and `steps` at the same time for the following jobs: release
on:
push:
branches:
- main
- dev
#on:
# workflow_call:
# inputs:
# tag:
# required: true
# type: string
jobs:
release:
uses: ./.github/workflows/compile.yaml
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
steps:
- name: Compose Release Tag
id: release_tag
run: |
if [[ ${{ github.event_name }} == "pull_request" ]]; then
SHA=${{ github.event.pull_request.head.sha }}
else
SHA=$(echo "$GITHUB_CONTEXT" | jq '.event.commits[].id' | tail -2 | head -1 | sed 's/\"//g')
fi
DATE=$(git show -s --format=%ad --date=format:'%Y-%m-%d' $SHA)
TAG=dev-$DATE-${SHA::8}
echo "SHA: $SHA"
echo "TAG: $TAG"
echo "TAG=$TAG" >> $GITHUB_OUTPUT
echo "SHA=$SHA" >> $GITHUB_OUTPUT
# - name: login
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}"
- name: Test release
id: test_release
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git checokut -b dev-nightly
git add .
git commit -m "generated"
git push origin dev-nightly
- name: Release
id: release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
REPO=$(echo "$GITHUB_CONTEXT" | jq -r '.repository')
TAG=${{ steps.release_tag.outputs.TAG }}
SHA=${{ steps.release_tag.outputs.SHA }}
# git tag -a ${{ steps.release_tag.outputs.TAG }}
# git push --follow-tags
gh api repos/$REPO/git/refs -f ref="refs/tags/$TAG" -f sha="$SHA"
# gh release create ${{ steps.release_tag.outputs.TAG }} --repo "$REPO" --title "some title" --generate-notes