-
Notifications
You must be signed in to change notification settings - Fork 131
100 lines (97 loc) · 3.77 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
# 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: Cosmos 5 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
steps:
- uses: actions/checkout@v3
- name: Set up Ruby 3.1
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
bundler-cache: false # runs 'bundle install' and caches installed gems automatically
working-directory: cosmos
- uses: actions/setup-node@v3
with:
node-version: "16.x"
registry-url: "https://registry.npmjs.org"
- 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: Update version to desired
run: ruby cosmos_set_versions.rb
working-directory: scripts/release
env:
COSMOS_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_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:
COSMOS_RELEASE_VERSION: ${{ github.event.inputs.version }}
COSMOS_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:
COSMOS_REGISTRY: docker.io
COSMOS_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 npm packages
if: ${{ github.event.inputs.update_latest == true }}
run: npm publish --access public
working-directory: cosmos-init/plugins/packages/cosmosc2-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: cosmos-init/plugins/packages/cosmosc2-tool-common
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Update version to next
run: ruby cosmos_set_versions.rb
working-directory: scripts/release
env:
COSMOS_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 }}"