OpenC3 Release #39
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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@v3 | |
- 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@v3 | |
with: | |
node-version: "16.x" | |
registry-url: "https://registry.npmjs.org" | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
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@v2 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Login to the GitHub Container registry | |
uses: docker/login-action@v2 | |
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@v4 | |
with: | |
commit_message: "[Github Action] Update version to ${{ github.event.inputs.version }}" | |
tagging_message: "v${{ github.event.inputs.version }}" | |
- 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@b7f401de30cb6434a1e19f805ff006643653240e | |
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@v4 | |
with: | |
commit_message: "[Github Action] Update version to ${{ github.event.inputs.next_version }}" |