|
| 1 | +on: |
| 2 | + pull_request: |
| 3 | + |
| 4 | +jobs: |
| 5 | + build_release_assets: |
| 6 | + uses: ./.github/workflows/build_release_assets.yml |
| 7 | + secrets: inherit |
| 8 | + with: |
| 9 | + release_mode: true |
| 10 | + |
| 11 | + push_to_pypi: |
| 12 | + needs: build_release_assets |
| 13 | + runs-on: ubuntu-22.04 |
| 14 | + steps: |
| 15 | + - uses: actions/checkout@v4 |
| 16 | + - name: Set up Python |
| 17 | + uses: actions/setup-python@v5 |
| 18 | + with: |
| 19 | + python-version: '3.x' |
| 20 | + |
| 21 | + - name: Download wheel and sdist |
| 22 | + uses: actions/download-artifact@v4 |
| 23 | + with: |
| 24 | + name: dist |
| 25 | + path: dist |
| 26 | + |
| 27 | + - name: Fake Publish distribution 📦 to PyPI |
| 28 | + run: tree dist |
| 29 | + |
| 30 | + release: |
| 31 | + runs-on: ubuntu-22.04 |
| 32 | + needs: build_release_assets |
| 33 | + continue-on-error: true |
| 34 | + |
| 35 | + # This is required for `gh release create` to work |
| 36 | + permissions: |
| 37 | + contents: write |
| 38 | + |
| 39 | + steps: |
| 40 | + - name: Checkout |
| 41 | + uses: actions/checkout@v4 |
| 42 | + with: |
| 43 | + fetch-depth: 0 |
| 44 | + |
| 45 | + - name: Read info |
| 46 | + id: tags |
| 47 | + shell: bash |
| 48 | + run: | |
| 49 | + echo "tag=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT |
| 50 | +
|
| 51 | + - name: Download OS packages |
| 52 | + uses: actions/download-artifact@v4 |
| 53 | + with: |
| 54 | + pattern: os-packages-* |
| 55 | + path: packages |
| 56 | + merge-multiple: true |
| 57 | + |
| 58 | + # - name: Create release |
| 59 | + # env: |
| 60 | + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 61 | + # run: | |
| 62 | + # gh release create --draft ${{ steps.tags.outputs.tag }} |
| 63 | + |
| 64 | + - name: Fake Upload release assets |
| 65 | + env: |
| 66 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 67 | + run: | |
| 68 | + ls \ |
| 69 | + packages/ggshield-*.pkg \ |
| 70 | + packages/ggshield_*.deb \ |
| 71 | + packages/ggshield-*.rpm \ |
| 72 | + packages/ggshield-*.gz |
| 73 | +
|
| 74 | + # push_to_docker_hub: |
| 75 | + # name: Push Docker image to Docker Hub |
| 76 | + # runs-on: ubuntu-22.04 |
| 77 | + # if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') |
| 78 | + # steps: |
| 79 | + # - name: Checkout |
| 80 | + # uses: actions/checkout@v4 |
| 81 | + # - name: Build and push |
| 82 | + # uses: docker/build-push-action@v1 |
| 83 | + # with: |
| 84 | + # username: ${{ secrets.DOCKER_USERNAME }} |
| 85 | + # password: ${{ secrets.DOCKER_PASSWORD }} |
| 86 | + # repository: gitguardian/ggshield |
| 87 | + # tag_with_ref: true |
| 88 | + # tags: latest |
| 89 | + |
| 90 | + # push_to_github_packages: |
| 91 | + # name: Push Docker image to GitHub Packages |
| 92 | + # runs-on: ubuntu-22.04 |
| 93 | + # if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') |
| 94 | + # steps: |
| 95 | + # - name: Check out the repo |
| 96 | + # uses: actions/checkout@v4 |
| 97 | + # - name: Push to GitHub Packages |
| 98 | + # uses: docker/build-push-action@v1 |
| 99 | + # with: |
| 100 | + # username: ${{ github.actor }} |
| 101 | + # password: ${{ secrets.GITHUB_TOKEN }} |
| 102 | + # registry: docker.pkg.github.com |
| 103 | + # repository: gitguardian/ggshield/ggshield |
| 104 | + # tag_with_ref: true |
| 105 | + # tags: latest |
| 106 | + |
| 107 | + # push_to_tap: |
| 108 | + # needs: push_to_pypi |
| 109 | + # name: Push to GitGuardian taps |
| 110 | + # runs-on: ubuntu-22.04 |
| 111 | + # if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') |
| 112 | + # steps: |
| 113 | + # - name: Set up Python 3.9 |
| 114 | + # uses: actions/setup-python@v5 |
| 115 | + # with: |
| 116 | + # python-version: 3.9 |
| 117 | + |
| 118 | + # - name: Checkout Homebrew-tap |
| 119 | + # uses: actions/checkout@v4 |
| 120 | + # with: |
| 121 | + # repository: GitGuardian/homebrew-tap |
| 122 | + # token: ${{ secrets.PAT_GITHUB }} |
| 123 | + |
| 124 | + # - name: Update Homebrew-tap |
| 125 | + # run: | |
| 126 | + # version=${GITHUB_REF/refs\/tags\/v/} |
| 127 | + |
| 128 | + # git config user.name github-actions |
| 129 | + # git config user.email [email protected] |
| 130 | + |
| 131 | + # scripts/update-ggshield --commit "$version" |
| 132 | + |
| 133 | + # git push |
| 134 | + |
| 135 | + push_to_cloudsmith: |
| 136 | + needs: build_release_assets |
| 137 | + runs-on: ubuntu-22.04 |
| 138 | + steps: |
| 139 | + - name: Checkout |
| 140 | + uses: actions/checkout@v4 |
| 141 | + |
| 142 | + - name: Download packages |
| 143 | + uses: actions/download-artifact@v4 |
| 144 | + with: |
| 145 | + pattern: os-packages-* |
| 146 | + path: packages |
| 147 | + merge-multiple: true |
| 148 | + |
| 149 | + - name: Install Cloudsmith CLI |
| 150 | + run: pip install cloudsmith-cli |
| 151 | + |
| 152 | + - name: Fake Push to Cloudsmith |
| 153 | + run: | |
| 154 | + tree packages |
0 commit comments