Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release ID not being found when created in previous workflow job #20

Closed
wattry opened this issue May 8, 2020 · 2 comments
Closed

Release ID not being found when created in previous workflow job #20

wattry opened this issue May 8, 2020 · 2 comments

Comments

@wattry
Copy link
Contributor

wattry commented May 8, 2020

This is a feature request to add an optional release id input so that releases created in the workflow template can be used. This will allow us to automate the whole release cycle. Since we only add a branch into master when we are ready to make a release.

We are using a GitHub action workflow to create a release, create binaries, and finally publish them using github-action-publish-binaries to the release that was created in the first job.

How we'd like to run our workflow.

name: Create Releases

on:
  push:
    branches: [ master ]

jobs:
  create-release:
    runs-on: ubuntu-latest
    outputs:
      releaseId: ${{ steps.create-release.output.id }}
    steps:
      - name: Create Release
        id: create_release
        uses: actions/create-release@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          tag_name: 1.0.0
          release_name: 1.0.0

  build-binaries:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v1
        with:
          node-version: 12
      - run: npm install
      - run: npm run build
      - uses: actions/upload-artifact@v1
        with:
          name: dist
          path: dist

  publish-binaries:
    runs-on: ubuntu-latest
    needs: [create-release, build-binaries]
    steps:
      - uses: skx/github-action-publish-binaries@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          releaseId: ${{ needs.create-release.outputs.releaseId }}
          args: 'dist/*'

My suggestion is to use the release Id if one is provided or just use the event if there is not one. This would allow us to make manual releases on feature branches and still automate releases to master.

I'm not a super proficient bash scripter so I will put in a PR, feel free to leave me some advice.

Thanks in advance.

@skx
Copy link
Owner

skx commented May 9, 2020

Looks like this will be fixed in #21 - thanks for the contribution, just offered minor feedback there.

@skx
Copy link
Owner

skx commented May 14, 2020

Closed in #21, available in release-0.14.

@skx skx closed this as completed May 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants