|
1 | | -name: Publish camel to PyPI / GitHub |
| 1 | +name: Publish CAMEL to PyPI / GitHub |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
|
8 | 8 | workflow_dispatch: |
9 | 9 |
|
10 | 10 | jobs: |
11 | | - build-n-publish: |
| 11 | + build-and-publish-pypi: |
12 | 12 | name: Build and publish to PyPI |
13 | 13 | runs-on: ubuntu-latest |
14 | 14 | permissions: |
15 | 15 | contents: write |
16 | 16 |
|
17 | 17 | steps: |
18 | | - - uses: actions/checkout@v3 |
19 | | - - name: Build and publish to pypi |
| 18 | + - name: Checkout code |
| 19 | + uses: actions/checkout@v4 |
| 20 | + |
| 21 | + - name: Build and publish to PyPI |
20 | 22 | uses: JRubics/poetry-publish@v1.17 |
21 | 23 | with: |
22 | 24 | pypi_token: ${{ secrets.PYPI_API_KEY }} |
23 | 25 | ignore_dev_requirements: "yes" |
24 | 26 |
|
25 | | - - name: Create GitHub Release |
26 | | - id: create_release |
27 | | - uses: actions/create-release@v1 |
28 | | - env: |
29 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token |
30 | | - with: |
31 | | - tag_name: ${{ github.ref }} |
32 | | - release_name: ${{ github.ref }} |
33 | | - draft: false |
34 | | - prerelease: false |
| 27 | + create-release: |
| 28 | + name: Create GitHub Release |
| 29 | + runs-on: ubuntu-latest |
| 30 | + permissions: |
| 31 | + contents: write |
| 32 | + steps: |
| 33 | + - name: Checkout code |
| 34 | + uses: actions/checkout@v4 |
35 | 35 |
|
36 | 36 | - name: Get Asset name |
37 | 37 | run: | |
38 | 38 | export PKG=$(ls dist/ | grep tar) |
39 | 39 | set -- $PKG |
40 | 40 | echo "name=$1" >> $GITHUB_ENV |
41 | | - - name: Upload Release Asset (sdist) to GitHub |
42 | | - id: upload-release-asset |
43 | | - uses: actions/upload-release-asset@v1 |
44 | | - env: |
45 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 41 | +
|
| 42 | + - name: Release to GitHub |
| 43 | + uses: softprops/action-gh-release@v2 |
| 44 | + with: |
| 45 | + generate_release_notes: true |
| 46 | + draft: false |
| 47 | + prerelease: false |
| 48 | + files: | |
| 49 | + dist/${{ env.name }} |
| 50 | +
|
| 51 | + build-and-publish-image: |
| 52 | + runs-on: ubuntu-latest |
| 53 | + permissions: |
| 54 | + contents: read |
| 55 | + packages: write |
| 56 | + |
| 57 | + steps: |
| 58 | + - name: Checkout code |
| 59 | + uses: actions/checkout@v4 |
| 60 | + |
| 61 | + - name: Log in to GitHub Container Registry |
| 62 | + uses: docker/login-action@v3 |
| 63 | + with: |
| 64 | + registry: ghcr.io |
| 65 | + username: ${{ github.actor }} |
| 66 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 67 | + |
| 68 | + - name: Set up Docker Buildx |
| 69 | + uses: docker/setup-buildx-action@v3 |
| 70 | + |
| 71 | + - name: Build and Push Docker image |
| 72 | + uses: docker/build-push-action@v5 |
46 | 73 | with: |
47 | | - upload_url: ${{ steps.create_release.outputs.upload_url }} |
48 | | - asset_path: dist/${{ env.name }} |
49 | | - asset_name: ${{ env.name }} |
50 | | - asset_content_type: application/zip |
| 74 | + context: . |
| 75 | + file: .container/minimal_build/Dockerfile |
| 76 | + push: true |
| 77 | + tags: | |
| 78 | + ghcr.io/${{ github.repository }}:latest |
| 79 | + ghcr.io/${{ github.repository }}:${{ github.ref_name }} |
| 80 | + platforms: linux/amd64,linux/arm64 |
| 81 | + sbom: false |
| 82 | + provenance: false |
| 83 | + labels: | |
| 84 | + org.opencontainers.image.source=https://github.com/${{ github.repository }} |
| 85 | + org.opencontainers.image.revision=${{ github.sha }} |
0 commit comments