From de8883e4531cfcca49284c983a0aea19564a4074 Mon Sep 17 00:00:00 2001 From: Arvind Iyengar Date: Sun, 23 May 2021 01:08:55 -0700 Subject: [PATCH] Replace drone with Github Workflow on release --- .drone.yml | 221 --------------------------------- .github/workflows/release.yaml | 45 +++++++ 2 files changed, 45 insertions(+), 221 deletions(-) delete mode 100644 .drone.yml create mode 100644 .github/workflows/release.yaml diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 27f38673..00000000 --- a/.drone.yml +++ /dev/null @@ -1,221 +0,0 @@ ---- -kind: pipeline -name: amd64 - -platform: - os: linux - arch: amd64 - -steps: -- name: build - image: rancher/dapper:v0.4.1 - commands: - - dapper ci - volumes: - - name: docker - path: /var/run/docker.sock - -- name: github_binary_release - image: plugins/github-release - settings: - api_key: - from_secret: github_token - prerelease: true - checksum: - - sha256 - checksum_file: CHECKSUMsum-amd64.txt - checksum_flatten: true - files: - - "dist/artifacts/*" - when: - instance: - - drone-publish.rancher.io - ref: - - refs/head/master - - refs/tags/* - event: - - tag - -- name: docker-publish - image: plugins/docker - settings: - dockerfile: package/Dockerfile - password: - from_secret: docker_password - repo: "rancher/charts-build-scripts" - tag: "${DRONE_TAG}-amd64" - username: - from_secret: docker_username - when: - instance: - - drone-publish.rancher.io - ref: - - refs/head/master - - refs/tags/* - event: - - tag - -volumes: -- name: docker - host: - path: /var/run/docker.sock - ---- -kind: pipeline -name: arm64 - -platform: - os: linux - arch: arm64 - -steps: -- name: build - image: rancher/dapper:v0.4.1 - commands: - - dapper ci - volumes: - - name: docker - path: /var/run/docker.sock - -- name: github_binary_release - image: plugins/github-release - settings: - api_key: - from_secret: github_token - prerelease: true - checksum: - - sha256 - checksum_file: CHECKSUMsum-arm64.txt - checksum_flatten: true - files: - - "dist/artifacts/*" - when: - instance: - - drone-publish.rancher.io - ref: - - refs/head/master - - refs/tags/* - event: - - tag - -- name: docker-publish - image: plugins/docker - settings: - dockerfile: package/Dockerfile - password: - from_secret: docker_password - repo: "rancher/charts-build-scripts" - tag: "${DRONE_TAG}-arm64" - username: - from_secret: docker_username - when: - instance: - - drone-publish.rancher.io - ref: - - refs/head/master - - refs/tags/* - event: - - tag - -volumes: -- name: docker - host: - path: /var/run/docker.sock - ---- -kind: pipeline -name: arm - -platform: - os: linux - arch: arm - -steps: -- name: build - image: rancher/dapper:v0.4.1 - commands: - - dapper ci - volumes: - - name: docker - path: /var/run/docker.sock - -- name: github_binary_release - image: plugins/github-release - settings: - api_key: - from_secret: github_token - prerelease: true - checksum: - - sha256 - checksum_file: CHECKSUMsum-arm.txt - checksum_flatten: true - files: - - "dist/artifacts/*" - when: - instance: - - drone-publish.rancher.io - ref: - - refs/head/master - - refs/tags/* - event: - - tag - -- name: docker-publish - image: plugins/docker - settings: - dockerfile: package/Dockerfile - password: - from_secret: docker_password - repo: "rancher/charts-build-scripts" - tag: "${DRONE_TAG}-arm" - username: - from_secret: docker_username - when: - instance: - - drone-publish.rancher.io - ref: - - refs/head/master - - refs/tags/* - event: - - tag - -volumes: -- name: docker - host: - path: /var/run/docker.sock - ---- -kind: pipeline -name: manifest - -platform: - os: linux - arch: amd64 - -steps: -- name: manifest - image: plugins/manifest:1.0.2 - settings: - username: - from_secret: docker_username - password: - from_secret: docker_password - platforms: - - linux/amd64 - - linux/arm64 - - linux/arm - target: "rancher/charts-build-scripts:${DRONE_TAG}" - template: "rancher/charts-build-scripts:${DRONE_TAG}-ARCH" - when: - instance: - - drone-publish.rancher.io - ref: - - refs/head/master - - refs/tags/* - event: - - tag - -depends_on: -- amd64 -- arm64 -- arm diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..4f90ec71 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,45 @@ +on: + release: + types: [created] + +jobs: + build-assets: + runs-on: ubuntu-latest + container: + image: rancher/dapper:v0.5.4 + steps: + - uses: actions/checkout@v2 + - name: Build binaries + env: + CROSS: true + run: make build + - name: Get release + id: get_release + uses: bruceadams/get-release@v1.2.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.get_release.outputs.upload_url }} + asset_path: bin/charts-build-scripts + asset_name: charts-build-scripts + asset_content_type: application/octet-stream + - uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.get_release.outputs.upload_url }} + asset_path: bin/charts-build-scripts-darwin + asset_name: charts-build-scripts-darwin + asset_content_type: application/octet-stream + - uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.get_release.outputs.upload_url }} + asset_path: bin/charts-build-scripts-windows + asset_name: charts-build-scripts-windows + asset_content_type: application/octet-stream +