-
Notifications
You must be signed in to change notification settings - Fork 31
138 lines (135 loc) · 5.14 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: OpenC3 Release
on:
workflow_dispatch:
inputs:
version:
description: "Version string"
required: true
type: string
next_version:
description: "Next version string"
required: true
type: string
update_latest:
description: "Update latest tag"
required: true
type: boolean
default: true
jobs:
release:
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
environment: Release
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.QA_PAT }}
- name: Set up Ruby 3.2
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
bundler-cache: false # runs 'bundle install' and caches installed gems automatically
working-directory: openc3
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: "https://registry.npmjs.org"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install dependencies
working-directory: openc3/python
run: |
python -m pip install --upgrade pip
pip install build
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to the GitHub Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Update version to desired
run: ruby openc3_set_versions.rb
working-directory: scripts/release
env:
OPENC3_RELEASE_VERSION: ${{ github.event.inputs.version }}
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "[Github Action] Update version to ${{ github.event.inputs.version }}"
tagging_message: "v${{ github.event.inputs.version }}"
push_options: --force
- name: Build Python Package
working-directory: openc3/python
run: python -m build
- name: build_multi_arch
# This `shell` line is required to get around a known issue: https://github.com/actions/runner/issues/241#issuecomment-745902718
shell: 'script -q -e -c "bash {0}"'
run: ./build_multi_arch.sh
working-directory: scripts/release
env:
OPENC3_DEPENDENCY_REGISTRY: docker.io
OPENC3_ENTERPRISE_REGISTRY: ghcr.io
OPENC3_ENTERPRISE_NAMESPACE: openc3
OPENC3_REGISTRY: docker.io
OPENC3_NAMESPACE: openc3inc
OPENC3_RELEASE_VERSION: ${{ github.event.inputs.version }}
OPENC3_UPDATE_LATEST: ${{ github.event.inputs.update_latest }}
- name: extract gems
# This `shell` line is required to get around a known issue: https://github.com/actions/runner/issues/241#issuecomment-745902718
shell: 'script -q -e -c "bash {0}"'
run: ./extract_gems.sh
working-directory: scripts/release
env:
OPENC3_DEPENDENCY_REGISTRY: docker.io
OPENC3_ENTERPRISE_REGISTRY: ghcr.io
OPENC3_ENTERPRISE_NAMESPACE: openc3
OPENC3_REGISTRY: docker.io
OPENC3_NAMESPACE: openc3inc
OPENC3_RELEASE_VERSION: ${{ github.event.inputs.version }}
- name: publish gems
run: ruby publish_gems.rb
working-directory: scripts/release
env:
GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }}
- name: Publish python package
uses: pypa/gh-action-pypi-publish@fb13cb306901256ace3dab689990e13a5550ffaa
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages-dir: openc3/python/dist
- name: publish npm packages
if: ${{ github.event.inputs.update_latest == 'true' }}
run: npm publish --access public
working-directory: openc3-cosmos-init/plugins/packages/openc3-tool-common
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: publish npm packages pre
if: ${{ github.event.inputs.update_latest != 'true' }}
run: npm publish --tag pre --access public
working-directory: openc3-cosmos-init/plugins/packages/openc3-tool-common
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Update version to next
run: ruby openc3_set_versions.rb
working-directory: scripts/release
env:
OPENC3_RELEASE_VERSION: ${{ github.event.inputs.next_version }}
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "[Github Action] Update version to ${{ github.event.inputs.next_version }}"
push_options: --force