mirror of https://git.tuxpa.in/a/code-server.git
Add github release creation
This commit is contained in:
parent
61d1af0413
commit
0d31a51eeb
|
@ -1,5 +1,8 @@
|
|||
name: ci
|
||||
on: [push, pull_request, release]
|
||||
name: code
|
||||
on: [push, pull_request]
|
||||
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
jobs:
|
||||
fmt:
|
||||
|
@ -21,8 +24,6 @@ jobs:
|
|||
uses: ./ci/image
|
||||
with:
|
||||
args: yarn && yarn vscode && yarn fmt
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -43,8 +44,6 @@ jobs:
|
|||
uses: ./ci/image
|
||||
with:
|
||||
args: yarn && yarn vscode && yarn lint
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -65,47 +64,3 @@ jobs:
|
|||
uses: ./ci/image
|
||||
with:
|
||||
args: yarn && yarn vscode && yarn test
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
release-linux-amd64:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: Get yarn cache directory path
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
- uses: actions/cache@v1
|
||||
with:
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-yarn-
|
||||
|
||||
- name: Run release.sh
|
||||
uses: ./ci/image
|
||||
with:
|
||||
args: yarn && yarn vscode && ./ci/release.sh
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
release-macos:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: Get yarn cache directory path
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
- uses: actions/cache@v1
|
||||
with:
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-yarn-
|
||||
|
||||
- name: Run release.sh
|
||||
run: yarn && yarn vscode && ./ci/release.sh
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@ -0,0 +1,113 @@
|
|||
name: release
|
||||
on:
|
||||
push:
|
||||
# tags:
|
||||
# - 'v*'
|
||||
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
jobs:
|
||||
linux-amd64:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: Get yarn cache directory path
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
- uses: actions/cache@v1
|
||||
with:
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-yarn-
|
||||
|
||||
- name: Run release.sh
|
||||
uses: ./ci/image
|
||||
with:
|
||||
args: yarn && yarn vscode && ./ci/release.sh
|
||||
env:
|
||||
PACKAGE: true
|
||||
- name: Get release name
|
||||
id: get-release-name
|
||||
run: echo "::set-output name=name::$(cd release && ls *.tar.gz)"
|
||||
|
||||
- name: Upload release as artifact
|
||||
uses: actions/upload-artifact@master
|
||||
with:
|
||||
name: ${{ steps.get-release-name.outputs.name }}
|
||||
path: release/${{ steps.get-release-name.outputs.name }}
|
||||
|
||||
- name: Create Release
|
||||
id: create-release
|
||||
uses: actions/create-release@v1
|
||||
with:
|
||||
tag_name: v2.1.0
|
||||
release_name: Release v2.1.0
|
||||
draft: true
|
||||
- name: Upload release
|
||||
id: upload-release-asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
with:
|
||||
upload_url: ${{ steps.create-release.outputs.upload_url }}
|
||||
asset_name: ${{ steps.get-release-name.outputs.name }}
|
||||
asset_path: release/${{ steps.get-release-name.outputs.name }}
|
||||
asset_content_type: application/gzip
|
||||
|
||||
- name: Copy release into release image build context
|
||||
uses: ./ci/image
|
||||
with:
|
||||
args: cp release/${{ steps.get-release-name.outputs.name }} ci/release-image
|
||||
- name: Publish codercom/code-server docker container
|
||||
uses: elgohr/Publish-Docker-Github-Action@master
|
||||
with:
|
||||
name: codercom/code-server
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
context: ci/release-image
|
||||
tags: "anmol"
|
||||
|
||||
macos:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: Get yarn cache directory path
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||
- uses: actions/cache@v1
|
||||
with:
|
||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-yarn-
|
||||
|
||||
- name: Run release.sh
|
||||
run: yarn && yarn vscode && ./ci/release.sh
|
||||
env:
|
||||
PACKAGE: true
|
||||
- name: Get release name
|
||||
id: get-release-name
|
||||
run: echo "::set-output name=name::$(cd release && ls *.zip)"
|
||||
|
||||
- name: Upload release as artifact
|
||||
uses: actions/upload-artifact@master
|
||||
with:
|
||||
name: ${{ steps.get-release-name.outputs.name }}
|
||||
path: release/${{ steps.get-release-name.outputs.name }}
|
||||
|
||||
- name: Create Release
|
||||
id: create-release
|
||||
uses: actions/create-release@v1
|
||||
with:
|
||||
tag_name: v2.1.0
|
||||
release_name: Release v2.1.0
|
||||
draft: true
|
||||
- name: Upload release
|
||||
uses: actions/upload-release-asset@v1
|
||||
with:
|
||||
upload_url: ${{ steps.create-release.outputs.upload_url }}
|
||||
asset_name: ${{ steps.get-release-name.outputs.name }}
|
||||
asset_path: release/${{ steps.get-release-name.outputs.name }}
|
||||
asset_content_type: application/zip
|
|
@ -5,3 +5,4 @@ dist*
|
|||
out*
|
||||
release
|
||||
node_modules
|
||||
binaries
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
code-server*.tar.gz
|
|
@ -3,11 +3,10 @@ FROM debian:10
|
|||
RUN apt-get update
|
||||
RUN apt-get install -y curl
|
||||
|
||||
ARG DOWNLOAD_URL=https://github.com/cdr/code-server/releases/download/2.1698/code-server2.1698-vsc1.41.1-linux-x86_64.tar.gz
|
||||
|
||||
RUN cd /tmp && curl -L "$DOWNLOAD_URL" | \
|
||||
tar -xz && \
|
||||
COPY code-server*.tar.gz /tmp
|
||||
RUN cd /tmp && tar -xzf code-server*.tar.gz && \
|
||||
cp code-server*/code-server /usr/local/bin/code-server
|
||||
RUN rm -rf /tmp/*
|
||||
|
||||
# https://wiki.debian.org/Locale#Manually
|
||||
RUN apt-get install -y locales
|
Loading…
Reference in New Issue