|
| 1 | +name: Create release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - "v*" |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: write |
| 10 | + |
| 11 | +jobs: |
| 12 | + release: |
| 13 | + name: Release pushed tag |
| 14 | + runs-on: ubuntu-22.04 |
| 15 | + steps: |
| 16 | + - name: Create release |
| 17 | + env: |
| 18 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 19 | + tag: ${{ github.ref_name }} |
| 20 | + run: | |
| 21 | + gh release create "$tag" \ |
| 22 | + --repo="$GITHUB_REPOSITORY" \ |
| 23 | + --title="$tag" \ |
| 24 | + --draft \ |
| 25 | + --generate-notes |
| 26 | + build-binary: |
| 27 | + name: Build (Linux) |
| 28 | + runs-on: ubuntu-latest |
| 29 | + env: |
| 30 | + BIN_NAME: icon |
| 31 | + |
| 32 | + steps: |
| 33 | + - name: Checkout |
| 34 | + uses: actions/checkout@v4 |
| 35 | + |
| 36 | + - name: Set up Python |
| 37 | + uses: actions/setup-python@v5 |
| 38 | + with: |
| 39 | + python-version: "3.13" |
| 40 | + |
| 41 | + - name: Install uv |
| 42 | + run: | |
| 43 | + curl -fsSL https://astral.sh/uv/install.sh | sh |
| 44 | + echo "$HOME/.local/bin" >> $GITHUB_PATH |
| 45 | +
|
| 46 | + - uses: webfactory/ssh-agent@v0.9.0 |
| 47 | + with: |
| 48 | + ssh-private-key: | |
| 49 | + ${{ secrets.GITLAB_TIQI_RPC_SSH_KEY }} |
| 50 | +
|
| 51 | + - name: Add gitlab.phys.ethz.ch to known hosts |
| 52 | + run: | |
| 53 | + mkdir -p ~/.ssh |
| 54 | + chmod 700 ~/.ssh |
| 55 | + ssh-keyscan gitlab.phys.ethz.ch >> ~/.ssh/known_hosts |
| 56 | +
|
| 57 | + - name: Sync build dependencies |
| 58 | + env: |
| 59 | + GL_DEPLOY_USER: ${{ secrets.GITLAB_DEPLOY_USER }} |
| 60 | + GL_DEPLOY_TOKEN: ${{ secrets.GITLAB_DEPLOY_TOKEN }} |
| 61 | + run: | |
| 62 | + uv sync --no-dev --extra server --group build |
| 63 | + uv pip install "git+https://$GL_DEPLOY_USER:$GL_DEPLOY_TOKEN@gitlab.phys.ethz.ch/tiqi-projects/drivers/tiqi-zedboard.git" |
| 64 | +
|
| 65 | + - name: Build with PyInstaller |
| 66 | + run: uv run pyinstaller icon.spec |
| 67 | + |
| 68 | + - name: Package artifact |
| 69 | + shell: bash |
| 70 | + run: | |
| 71 | + mkdir -p out |
| 72 | + cp "dist/${BIN_NAME}" "out/${BIN_NAME}-linux-amd64" |
| 73 | +
|
| 74 | + - name: Upload binaries to GitHub Release |
| 75 | + env: |
| 76 | + tag: ${{ github.ref_name }} |
| 77 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 78 | + run: | |
| 79 | + gh release upload "$tag" out/** \ |
| 80 | + --repo="$GITHUB_REPOSITORY" |
0 commit comments