-
Notifications
You must be signed in to change notification settings - Fork 6k
refactor: get version dynamically #5753
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 29 commits
cad9a41
42d4029
0b31a43
25e5f63
784ad56
ea99731
81d4f7f
e09a263
599587e
06b89aa
9749c68
4264a23
056acae
0ae3d03
9a34495
6dcc175
413c005
83c0801
5e4642e
3efac18
9cd480b
e503fa4
c08c0b7
c2c0afa
7aa1784
d9ff180
aabbe5e
9b41f78
17f16b7
2b77611
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,11 @@ on: | |
# Shows the manual trigger in GitHub UI | ||
# helpful as a back-up in case the GitHub Actions Workflow fails | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: The version to publish (include "v", i.e. "v4.9.1"). | ||
type: string | ||
required: true | ||
|
||
release: | ||
types: [released] | ||
|
@@ -24,21 +29,25 @@ jobs: | |
- name: Checkout code-server | ||
uses: actions/checkout@v3 | ||
|
||
- name: Get version | ||
id: version | ||
run: echo "::set-output name=version::$(jq -r .version package.json)" | ||
|
||
- name: Download npm package from release artifacts | ||
uses: robinraju/release-downloader@v1.5 | ||
with: | ||
repository: "coder/code-server" | ||
tag: v${{ steps.version.outputs.version }} | ||
tag: ${{ github.event.inputs.version || github.ref_name }} | ||
fileName: "package.tar.gz" | ||
out-file-path: "release-npm-package" | ||
|
||
# NOTE@jsjoeio - we do this so we can strip out the v | ||
# i.e. v4.9.1 -> 4.9.1 | ||
- name: Get and set VERSION | ||
run: | | ||
TAG="${{ github.event.inputs.version || github.ref_name }}" | ||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV | ||
|
||
- name: Publish npm package and tag with "latest" | ||
run: yarn publish:npm | ||
env: | ||
VERSION: ${{ env.VERSION }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
NPM_ENVIRONMENT: "production" | ||
|
@@ -62,9 +71,18 @@ jobs: | |
git config --global user.name cdrci | ||
git config --global user.email opensource@coder.com | ||
|
||
# NOTE@jsjoeio - we do this so we can strip out the v | ||
# i.e. v4.9.1 -> 4.9.1 | ||
- name: Get and set VERSION | ||
run: | | ||
TAG="${{ github.event.inputs.version || github.ref_name }}" | ||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV | ||
|
||
- name: Bump code-server homebrew version | ||
env: | ||
VERSION: ${{ env.VERSION }} | ||
HOMEBREW_GITHUB_API_TOKEN: ${{secrets.HOMEBREW_GITHUB_API_TOKEN}} | ||
|
||
run: ./ci/steps/brew-bump.sh | ||
|
||
aur: | ||
|
@@ -73,6 +91,8 @@ jobs: | |
timeout-minutes: 10 | ||
env: | ||
GH_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }} | ||
VERSION: ${{ github.event.inputs.version || github.ref_name }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need this line since we set version in another step? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think so? Don't we need to set it in every step? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm double-checking..i see what you mean now There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, you were right - nice catch. Removed! |
||
|
||
steps: | ||
# We need to checkout code-server so we can get the version | ||
- name: Checkout code-server | ||
|
@@ -81,13 +101,6 @@ jobs: | |
fetch-depth: 0 | ||
path: "./code-server" | ||
|
||
- name: Get code-server version | ||
id: version | ||
run: | | ||
pushd code-server | ||
echo "::set-output name=version::$(jq -r .version package.json)" | ||
popd | ||
|
||
- name: Checkout code-server-aur repo | ||
uses: actions/checkout@v3 | ||
with: | ||
|
@@ -106,10 +119,17 @@ jobs: | |
git config --global user.name cdrci | ||
git config --global user.email opensource@coder.com | ||
|
||
# NOTE@jsjoeio - we do this so we can strip out the v | ||
# i.e. v4.9.1 -> 4.9.1 | ||
- name: Get and set VERSION | ||
run: | | ||
TAG="${{ github.event.inputs.version || github.ref_name }}" | ||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV | ||
|
||
- name: Validate package | ||
uses: hapakaien/archlinux-package-action@v2 | ||
with: | ||
pkgver: ${{ steps.version.outputs.version }} | ||
pkgver: ${{ env.VERSION }} | ||
updpkgsums: true | ||
srcinfo: true | ||
|
||
|
@@ -147,19 +167,23 @@ jobs: | |
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Get version | ||
id: version | ||
run: echo "::set-output name=version::$(jq -r .version package.json)" | ||
# NOTE@jsjoeio - we do this so we can strip out the v | ||
# i.e. v4.9.1 -> 4.9.1 | ||
- name: Get and set VERSION | ||
run: | | ||
TAG="${{ github.event.inputs.version || github.ref_name }}" | ||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV | ||
|
||
- name: Download release artifacts | ||
uses: robinraju/release-downloader@v1.5 | ||
with: | ||
repository: "coder/code-server" | ||
tag: v${{ steps.version.outputs.version }} | ||
tag: v${{ env.VERSION }} | ||
fileName: "*.deb" | ||
out-file-path: "release-packages" | ||
|
||
- name: Publish to Docker | ||
run: yarn publish:docker | ||
env: | ||
VERSION: ${{ env.VERSION }} | ||
GITHUB_TOKEN: ${{ github.token }} |
Uh oh!
There was an error while loading. Please reload this page.