From e4ddffd0e2d23e90d418c0d6fccd9dc1d3465da2 Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Mon, 18 May 2020 13:48:45 -0400 Subject: [PATCH] Workaround for GH Actions stripping permissions Closes #1665 --- .github/issue_template.md | 4 ++-- .github/workflows/ci.yaml | 8 ++++---- .gitignore | 1 + ci/steps/publish-npm.sh | 4 ++-- ci/steps/release-static.sh | 2 +- ci/steps/release.sh | 4 ++++ 6 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/issue_template.md b/.github/issue_template.md index a3a11b3e..8c602d06 100644 --- a/.github/issue_template.md +++ b/.github/issue_template.md @@ -12,7 +12,7 @@ Please ensure you cannot reproduce on VS Code before filing. Please fill in the issue template or we will close your issue! --> -- Web Browser: +- Web Browser: - Local OS: - Remote OS: -- `code-server --version`: +- `code-server --version`: diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1191768b..115e9f34 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -42,7 +42,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: npm-package - path: ./release + path: ./release-npm-package linux-amd64: needs: release @@ -53,7 +53,7 @@ jobs: uses: actions/download-artifact@v2 with: name: npm-package - path: ./release + path: ./release-npm-package - name: Run ./ci/steps/release-static.sh uses: ./ci/container with: @@ -73,7 +73,7 @@ jobs: uses: actions/download-artifact@v2 with: name: npm-package - path: ./release + path: ./release-npm-package - name: Run ./ci/steps/release-static.sh uses: ./ci/container/arm64 with: @@ -93,7 +93,7 @@ jobs: uses: actions/download-artifact@v2 with: name: npm-package - path: ./release + path: ./release-npm-package - run: brew unlink node@12 - run: brew install node - run: ./ci/steps/release-static.sh diff --git a/.gitignore b/.gitignore index f171c575..788f4073 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ dist* out* release/ +release-npm-package/ release-static/ release-packages/ release-gcp/ diff --git a/ci/steps/publish-npm.sh b/ci/steps/publish-npm.sh index be6161bf..7bd497d0 100755 --- a/ci/steps/publish-npm.sh +++ b/ci/steps/publish-npm.sh @@ -9,9 +9,9 @@ main() { echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc fi - download_artifact npm-package ./release + download_artifact npm-package ./release-npm-package # https://github.com/actions/upload-artifact/issues/38 - chmod +x $(grep -rl '^#!/.*' release) + tar -xzf release-npm-package/package.tar.gz yarn publish --non-interactive release } diff --git a/ci/steps/release-static.sh b/ci/steps/release-static.sh index 08a4a1fa..591f994c 100755 --- a/ci/steps/release-static.sh +++ b/ci/steps/release-static.sh @@ -5,7 +5,7 @@ main() { cd "$(dirname "$0")/../.." # https://github.com/actions/upload-artifact/issues/38 - chmod +x $(grep -rl '^#!/.*' release) + tar -xzf release-npm-package/package.tar.gz yarn release:static yarn test:static-release diff --git a/ci/steps/release.sh b/ci/steps/release.sh index 94f1df8a..80083c67 100755 --- a/ci/steps/release.sh +++ b/ci/steps/release.sh @@ -9,6 +9,10 @@ main() { yarn build yarn build:vscode yarn release + + # https://github.com/actions/upload-artifact/issues/38 + mkdir -p release-npm-package + tar -czf release-npm-package/package.tar.gz release } main "$@"