Archived
1
0

refactor: get version dynamically (#5753)

* refactor: get version dynamically

* chore: remove version

* fixup: missing quotes

* refactor: drop global VERSION

* wip: updating ersion in publish

* refactor: update publish.yaml with version changes

* refactor: release.yaml with new version changes

* refactor: update build.yaml with version changes

* chore: update maintainer

* fixup: update version in build-vscode

* fixup: fix github env version

* try macos only

* try again

* last resort

* joe again

* this oneee

* fixup: this should work

* try using inputs

* docs: update release notes

* fixup!: use env.VERSION in docker step

* fixup!: comment get and set version

* fixup!: remove compress release package comment

* fixup!: use $VERSION in npm-version

* refactor: set VERSION in build VS Code step

* refactor: use 0.0.0 in package.json version

* refactor: delete release-prep script

* Update ci/build/build-vscode.sh

* fixup!: remove extra VERSION set in aur
This commit is contained in:
Joe Previte
2022-11-08 15:45:01 -07:00
committed by GitHub
parent 5a8bb2b8e8
commit b978655c07
10 changed files with 151 additions and 178 deletions

View File

@ -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,7 @@ jobs:
timeout-minutes: 10
env:
GH_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
steps:
# We need to checkout code-server so we can get the version
- name: Checkout code-server
@ -81,13 +100,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 +118,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 +166,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 }}