-
Notifications
You must be signed in to change notification settings - Fork 9
74 lines (63 loc) · 2.25 KB
/
release.yml
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
name: Release
on:
push:
branches: main
jobs:
release:
if: startsWith(github.event.head_commit.message, 'Copernicus Marine Release')
runs-on: self-hosted
timeout-minutes: 20
steps:
- name: Check out code
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: '1.5.6-0'
micromamba-binary-path: ${{ runner.temp }}/bin/micromamba
environment-file: conda_environment.yaml
environment-name: copernicusmarine
condarc-file: .condarc
cache-environment: true
post-cleanup: 'all'
- name: Build and publish Pypi package
shell: micromamba-shell {0}
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
poetry publish --build --username __token__ --password "${PYPI_TOKEN}"
- name: Set VERSION environment variable
id: set-version
shell: micromamba-shell {0}
run: echo "VERSION=$(poetry version --short)" >> $GITHUB_OUTPUT
- name: Create tag
shell: micromamba-shell {0}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git tag v${{ steps.set-version.outputs.VERSION }}
git push origin --tags
- name: Create Github release
shell: micromamba-shell {0}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create v${{ steps.set-version.outputs.VERSION }} --generate-notes
- name: Wait for Pypi version to be available
uses: cygnetdigital/[email protected]
with:
url: 'https://pypi.org/project/copernicusmarine/${{ steps.set-version.outputs.VERSION }}/'
responseCode: '200'
timeout: 600000
interval: 5000
- name: Wait 30sec for the version to be in pip
run: sleep 30s
shell: bash
- name: Build and publish Docker image
shell: micromamba-shell {0}
env:
VERSION: ${{ steps.set-version.outputs.VERSION }}
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
DOCKER_HUB_PUSH_TOKEN: ${{ secrets.DOCKER_HUB_PUSH_TOKEN }}
run: make build-and-publish-dockerhub-image