diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f32a13e6..56b083b1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -309,18 +309,17 @@ jobs: contents: write steps: - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 + uses: actions/checkout@v4 - name: Download build artifacts uses: actions/download-artifact@v4 with: name: build-artifact - path: .repo + path: dist - name: Build lambda run: docker build -t cdk-ecr-deployment-lambda --build-arg GOPROXY="https://goproxy.io|https://goproxy.cn|direct" lambda && docker run -v $PWD/lambda:/out cdk-ecr-deployment-lambda cp /asset/bootstrap /out && echo $(sha256sum lambda/bootstrap | awk '{ print $1 }') > lambda/bootstrap.sha256 - name: Release lambda env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_REPOSITORY: ${{ github.repository }} - run: "gh release upload --clobber -R $GITHUB_REPOSITORY v$(cat .repo/dist/version.txt) lambda/bootstrap lambda/bootstrap.sha256 " + GITHUB_REF: ${{ github.sha }} + run: "gh release upload --clobber -R $GITHUB_REPOSITORY $(cat dist/releasetag.txt) lambda/bootstrap lambda/bootstrap.sha256 " diff --git a/.projenrc.ts b/.projenrc.ts index 7c2c5e0c..7f273041 100644 --- a/.projenrc.ts +++ b/.projenrc.ts @@ -59,17 +59,14 @@ project.release?.addJobs({ steps: [ { name: 'Checkout', - uses: 'actions/checkout@v2', - with: { - 'fetch-depth': 0, - }, + uses: 'actions/checkout@v4', }, { name: 'Download build artifacts', uses: 'actions/download-artifact@v4', with: { name: 'build-artifact', - path: '.repo', + path: 'dist', }, }, { @@ -84,10 +81,11 @@ project.release?.addJobs({ name: 'Release lambda', // For some reason, need '--clobber' otherwise we always get errors that these files already exist. They're probably // uploaded elsewhere but TBH I don't know where so just add this flag to make it not fail. - run: 'gh release upload --clobber -R $GITHUB_REPOSITORY v$(cat .repo/dist/version.txt) lambda/bootstrap lambda/bootstrap.sha256 ', + run: 'gh release upload --clobber -R $GITHUB_REPOSITORY $(cat dist/releasetag.txt) lambda/bootstrap lambda/bootstrap.sha256 ', env: { GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}', GITHUB_REPOSITORY: '${{ github.repository }}', + GITHUB_REF: '${{ github.sha }}', }, }, ],