efabless_tapeout #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: efabless_tapeout | |
on: | |
workflow_dispatch: | |
jobs: | |
efabless_tapeout: | |
env: | |
EFABLESS_REPO: ${{ vars.EFABLESS_REPO }} | |
GIT_SSH_COMMAND: 'ssh -i ~/.id_ed25519 -o IdentitiesOnly=yes -o StrictHostKeyChecking=no' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifact | |
uses: dawidd6/action-download-artifact@v3 | |
id: download_artifact | |
with: | |
workflow: gds.yaml | |
workflow_conclusion: success | |
name: efabless_submission | |
path: tinytapeout_submission | |
- name: Checkout repo | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Tiny Tapeout Bot" | |
touch ~/.id_ed25519 | |
chmod 600 ~/.id_ed25519 | |
echo "$EFABLESS_REPO_SSH_KEY" > ~/.id_ed25519 | |
git clone "$EFABLESS_REPO" tt_efabless | |
env: | |
# To generate a new key: ssh-keygen -o -t ed25519 -C "[email protected]" | |
EFABLESS_REPO_SSH_KEY: ${{ secrets.EFABLESS_REPO_SSH_KEY }} | |
- name: Copy files | |
working-directory: tt_efabless | |
run: | | |
rm -rf gds lef lvs verilog README.md shuttle_index.json | |
cp -r ../tinytapeout_submission/* . | |
- name: Commit and push | |
working-directory: tt_efabless | |
shell: bash | |
env: | |
WORKFLOW_URL: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ fromJSON(steps.download_artifact.outputs.artifacts)[0].workflow_run.id }}' | |
WORKFLOW_HEAD_SHA: '${{ fromJSON(steps.download_artifact.outputs.artifacts)[0].workflow_run.head_sha }}' | |
run: | | |
COMMIT_BODY="\ | |
run: $WORKFLOW_URL | |
commit: $WORKFLOW_HEAD_SHA | |
" | |
DATE=$(date +%Y%m%d) | |
SHORT_SHA=$(echo $WORKFLOW_HEAD_SHA | cut -c1-7) | |
echo "┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓" | |
echo "┃ Tapeout job name: TT-${DATE}-${SHORT_SHA} ┃" | |
echo "┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛" | |
echo "" | |
echo "Tapeout job name: \`TT-${DATE}-${SHORT_SHA}\`" >> $GITHUB_STEP_SUMMARY | |
echo "Workflow run: $WORKFLOW_URL" >> $GITHUB_STEP_SUMMARY | |
git add -A | |
if ! git diff-index --quiet HEAD; then | |
git commit -m "update shuttle ($SHORT_SHA)" -m "$COMMIT_BODY" | |
fi | |
echo "" | |
git log -1 | |
git push |