diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c0d77b0e..ab726485 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,13 +1,13 @@ name: release on: - push: - tags: - - 'v*' + release: + types: + - published env: GCS_BUCKET: images.metal-pod.io - + jobs: build: runs-on: ubuntu-latest @@ -19,6 +19,11 @@ jobs: version: '278.0.0' service_account_email: ${{ secrets.GCP_SA_EMAIL }} service_account_key: ${{ secrets.GCP_SA_KEY }} + - name: Get release + id: get_release + uses: bruceadams/get-release@v1.2.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Build image uses: metal-stack/action-docker-make@master with: @@ -33,22 +38,12 @@ jobs: cp metal-hammer-initrd.img.lz4* images/metal-hammer/${GITHUB_REF##*/} - name: Upload image tarballs to GCS run: gsutil -m cp -r -p images/metal-hammer gs://$GCS_BUCKET - - name: Create Release - id: create_release - uses: actions/create-release@v1.0.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: metal-hammer ${{ github.ref }} - draft: false - prerelease: false - name: Upload Release Asset uses: actions/upload-release-asset@v1.0.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ steps.create_release.outputs.upload_url }} + upload_url: ${{ steps.get_release.outputs.upload_url }} asset_path: metal-hammer-initrd.img.lz4 asset_name: metal-hammer-initrd.img.lz4 asset_content_type: application/gzip @@ -57,7 +52,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ steps.create_release.outputs.upload_url }} + upload_url: ${{ steps.get_release.outputs.upload_url }} asset_path: metal-hammer-initrd.img.lz4.md5 asset_name: metal-hammer-initrd.img.lz4.md5 - asset_content_type: text/html \ No newline at end of file + asset_content_type: text/html