File: release.yml

package info (click to toggle)
stactools 0.5.3-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 23,796 kB
  • sloc: python: 4,498; xml: 554; sh: 395; makefile: 34
file content (86 lines) | stat: -rw-r--r-- 2,345 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Release

on:
  push:
    tags:
      - "*"

env:
  DOCKER_REGISTRY: ghcr.io
  DOCKER_IMAGE_NAME: ${{ github.repository }}

jobs:
  release:
    name: release
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Set up Python 3.x
        uses: actions/setup-python@v4
        with:
          python-version: "3.x"

      - name: Install release dependencies
        run: |
          python -m pip install --upgrade pip
          pip install setuptools wheel twine

      - name: Build and publish package
        env:
          TWINE_USERNAME: ${{ secrets.PYPI_STACUTILS_USERNAME }}
          TWINE_PASSWORD: ${{ secrets.PYPI_STACUTILS_PASSWORD }}
        run: |
          scripts/publish
  docker:
    name: docker
    permissions:
      contents: read
      packages: write
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Login to GitHub Container Registry
        uses: docker/login-action@v3
        with:
          registry: ${{ env.DOCKER_REGISTRY }}
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}
      - name: Docker meta main
        id: meta-main
        uses: docker/metadata-action@v5
        with:
          images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}
          flavor: |
            latest=true
          tags: |
            type=pep440,pattern={{version}}
      - name: Build and push main
        uses: docker/build-push-action@v5
        with:
          context: .
          file: docker/Dockerfile
          target: main
          push: true
          tags: ${{ steps.meta-main.outputs.tags }}
          labels: ${{ steps.meta-main.outputs.labels }}
      - name: Docker meta dev
        id: meta-dev
        uses: docker/metadata-action@v5
        with:
          images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}
          flavor: |
            latest=true
            suffix=-dev,onlatest=true
          tags: |
            type=pep440,pattern={{version}}
      - name: Build and push dev
        uses: docker/build-push-action@v5
        with:
          context: .
          file: docker/Dockerfile
          target: dev
          push: true
          tags: ${{ steps.meta-dev.outputs.tags }}
          labels: ${{ steps.meta-dev.outputs.labels }}